]> granicus.if.org Git - esp-idf/commitdiff
ipc task: Allow configuration of IPC task stack size
authorAngus Gratton <angus@espressif.com>
Thu, 29 Jun 2017 23:39:54 +0000 (09:39 +1000)
committerAngus Gratton <gus@projectgus.com>
Fri, 30 Jun 2017 05:04:19 +0000 (15:04 +1000)
Fixes regression in 3fe0022ef

components/esp32/Kconfig
components/esp32/include/esp_ipc.h
components/esp32/ipc.c

index 0839226df3659a783af2d5605c3591ebfd67e521..88047870152f5850ba81ddabf94dc78ee932defb 100644 (file)
@@ -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"
index 7759e49d9d0dd39275ccf9e4233ec1a160eb9a63..28b17a9a3ed68650b0fb0679bd0f24d094788fe3 100644 (file)
@@ -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
index fce3fd430adcc022fd4adf6f1b3bea8572833207..41f7b8573f4bf01ae66bfcfc6ca68ea8d3818ced 100644 (file)
@@ -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);
     }
 }