Преглед изворни кода

ipc task: Allow configuration of IPC task stack size

Fixes regression in 3fe0022ef
Angus Gratton пре 8 година
родитељ
комит
9297edaf60
3 измењених фајлова са 22 додато и 2 уклоњено
  1. 17 1
      components/esp32/Kconfig
  2. 4 0
      components/esp32/include/esp_ipc.h
  3. 1 1
      components/esp32/ipc.c

+ 17 - 1
components/esp32/Kconfig

@@ -160,8 +160,24 @@ config MAIN_TASK_STACK_SIZE
     int "Main task stack size"
     default 4096
     help
-        Config system event task stack size in different application.
+        Configure the "main task" stack size. This is the stack of the task
+        which calls app_main(). If app_main() returns then this task is deleted
+        and its stack memory is freed.
+
+config IPC_TASK_STACK_SIZE
+    int "Inter-Processor Call (IPC) task stack size"
+    default 1024
+    range 512 65536 if !ESP32_APPTRACE_ENABLE
+    range 2048 65536 if ESP32_APPTRACE_ENABLE
+    help
+        Configure the IPC tasks stack size. One IPC task runs on each core
+        (in dual core mode), and allows for cross-core function calls.
+
+        See IPC documentation for more details.
 
+        The default stack size should be enough for most common use cases.
+        It can be shrunk if you are sure that you do not use any custom
+        IPC functionality.
 
 config NEWLIB_STDOUT_ADDCR
     bool "Standard-out output adds carriage return before newline"

+ 4 - 0
components/esp32/include/esp_ipc.h

@@ -57,6 +57,10 @@ void esp_ipc_init();
  *
  * In single-core mode, returns ESP_ERR_INVALID_ARG for cpu_id 1.
  *
+ * For complex functions, you may need to increase the stack size of the "IPC task"
+ * which runs the function must be sufficient. See the "Inter-Processor Call (IPC)
+ * task stack size" setting in menuconfig.
+ *
  * @param cpu_id CPU where function should be executed (0 or 1)
  * @param func pointer to a function which should be executed
  * @param arg arbitrary argument to be passed into function

+ 1 - 1
components/esp32/ipc.c

@@ -80,7 +80,7 @@ void esp_ipc_init()
     const char* task_names[2] = {"ipc0", "ipc1"};
     for (int i = 0; i < portNUM_PROCESSORS; ++i) {
         s_ipc_sem[i] = xSemaphoreCreateBinary();
-        xTaskCreatePinnedToCore(ipc_task, task_names[i], configMINIMAL_STACK_SIZE, (void*) i,
+        xTaskCreatePinnedToCore(ipc_task, task_names[i], CONFIG_IPC_TASK_STACK_SIZE, (void*) i,
                                 configMAX_PRIORITIES - 1, &s_ipc_tasks[i], i);
     }
 }