From c41541b83b3914458803e4bdc9ca91d6c85f9cab Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 10 Aug 2026 10:02:48 +0200 Subject: [PATCH] fix(ipc): fixed IPC task ending up in PSRAM With CONFIG_FREERTOS_PLACE_TASK_STACKS_IN_EXT_RAM enabled IPC task would end up in PSRAM, causing issues with disabling cache --- components/esp_system/esp_ipc.c | 8 +++++--- tools/test_apps/system/psram_stack/README.md | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/esp_system/esp_ipc.c b/components/esp_system/esp_ipc.c index 9141efd361a..8cda46c9632 100644 --- a/components/esp_system/esp_ipc.c +++ b/components/esp_system/esp_ipc.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -18,6 +18,7 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/semphr.h" +#include "freertos/idf_additions.h" #define IPC_MAX_PRIORITY (configMAX_PRIORITIES - 1) @@ -111,8 +112,9 @@ static void esp_ipc_init(void) task_name[3] = i + (char)'0'; s_ipc_mutex[i] = xSemaphoreCreateMutexStatic(&s_ipc_mutex_buffer[i]); s_ipc_ack[i] = xSemaphoreCreateBinaryStatic(&s_ipc_ack_buffer[i]); - BaseType_t res = xTaskCreatePinnedToCore(ipc_task, task_name, IPC_STACK_SIZE, (void*) i, - IPC_MAX_PRIORITY, &s_ipc_task_handle[i], i); + BaseType_t res = xTaskCreatePinnedToCoreWithCaps(ipc_task, task_name, IPC_STACK_SIZE, (void*) i, + IPC_MAX_PRIORITY, &s_ipc_task_handle[i], i, + MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); assert(res == pdTRUE); (void)res; } diff --git a/tools/test_apps/system/psram_stack/README.md b/tools/test_apps/system/psram_stack/README.md index 691f9018dee..0a0cf5d5c68 100644 --- a/tools/test_apps/system/psram_stack/README.md +++ b/tools/test_apps/system/psram_stack/README.md @@ -1,2 +1,2 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-H21 | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 | Linux | -| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | --------- | -------- | -------- | -------- | -------- | --------- | ----- | +| Supported Targets | ESP32 | ESP32-C5 | ESP32-C61 | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 | +| ----------------- | ----- | -------- | --------- | -------- | -------- | -------- | -------- | --------- |