feat(core): Support pthread using SPIRAM as stack (#4509)

Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
This commit is contained in:
ChenWen 2025-07-30 10:26:41 +08:00 committed by GitHub
parent 6c6447fadb
commit c6afa131a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -110,6 +110,13 @@ os_thread_create_with_prio(korp_tid *tid, thread_start_routine_t start,
targ->start = start;
targ->arg = arg;
#ifdef CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM
esp_pthread_cfg_t default_config = esp_pthread_get_default_config();
default_config.stack_alloc_caps = MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM;
ESP_ERROR_CHECK(esp_pthread_set_cfg(&default_config));
#endif
if (pthread_create(tid, &tattr, os_thread_wrapper, targ) != 0) {
pthread_attr_destroy(&tattr);
os_free(targ);