From ccc184de51e79470f5f6fc32796bb472f00e7e0f Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 18 Jul 2022 13:53:13 +0800 Subject: [PATCH] ipc: Increase stacksize when compiling with -O0 --- components/esp_system/esp_ipc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/esp_system/esp_ipc.c b/components/esp_system/esp_ipc.c index d015cafb02..8a1870b8d2 100644 --- a/components/esp_system/esp_ipc.c +++ b/components/esp_system/esp_ipc.c @@ -19,6 +19,12 @@ #if !defined(CONFIG_FREERTOS_UNICORE) || defined(CONFIG_APPTRACE_GCOV_ENABLE) +#if CONFIG_COMPILER_OPTIMIZATION_NONE +#define IPC_STACK_SIZE (CONFIG_ESP_IPC_TASK_STACK_SIZE + 0x100) +#else +#define IPC_STACK_SIZE (CONFIG_ESP_IPC_TASK_STACK_SIZE) +#endif //CONFIG_COMPILER_OPTIMIZATION_NONE + static DRAM_ATTR StaticSemaphore_t s_ipc_mutex_buffer[portNUM_PROCESSORS]; static DRAM_ATTR StaticSemaphore_t s_ipc_sem_buffer[portNUM_PROCESSORS]; static DRAM_ATTR StaticSemaphore_t s_ipc_ack_buffer[portNUM_PROCESSORS]; @@ -114,7 +120,7 @@ static void esp_ipc_init(void) s_ipc_mutex[i] = xSemaphoreCreateMutexStatic(&s_ipc_mutex_buffer[i]); s_ipc_ack[i] = xSemaphoreCreateBinaryStatic(&s_ipc_ack_buffer[i]); s_ipc_sem[i] = xSemaphoreCreateBinaryStatic(&s_ipc_sem_buffer[i]); - portBASE_TYPE res = xTaskCreatePinnedToCore(ipc_task, task_name, CONFIG_ESP_IPC_TASK_STACK_SIZE, (void*) i, + portBASE_TYPE res = xTaskCreatePinnedToCore(ipc_task, task_name, IPC_STACK_SIZE, (void*) i, configMAX_PRIORITIES - 1, &s_ipc_task_handle[i], i); assert(res == pdTRUE); (void)res;