Skip to content

Commit c6afa13

Browse files
authored
feat(core): Support pthread using SPIRAM as stack (#4509)
Signed-off-by: [email protected] <[email protected]>
1 parent 6c6447f commit c6afa13

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/shared/platform/esp-idf/espidf_thread.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ os_thread_create_with_prio(korp_tid *tid, thread_start_routine_t start,
110110
targ->start = start;
111111
targ->arg = arg;
112112

113+
#ifdef CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM
114+
esp_pthread_cfg_t default_config = esp_pthread_get_default_config();
115+
116+
default_config.stack_alloc_caps = MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM;
117+
ESP_ERROR_CHECK(esp_pthread_set_cfg(&default_config));
118+
#endif
119+
113120
if (pthread_create(tid, &tattr, os_thread_wrapper, targ) != 0) {
114121
pthread_attr_destroy(&tattr);
115122
os_free(targ);

0 commit comments

Comments
 (0)