diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index 5a5c9c4713..10a1bfe672 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -281,13 +281,13 @@ config SYSTEM_EVENT_QUEUE_SIZE config SYSTEM_EVENT_TASK_STACK_SIZE int "Event loop task stack size" - default 4096 + default 2048 help Config system event task stack size in different application. config MAIN_TASK_STACK_SIZE int "Main task stack size" - default 4096 + default 3584 help 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 @@ -310,7 +310,7 @@ config IPC_TASK_STACK_SIZE config TIMER_TASK_STACK_SIZE int "High-resolution timer task stack size" - default 4096 + default 3584 range 2048 65536 help Configure the stack size of esp_timer/ets_timer task. This task is used diff --git a/components/esp32/include/esp_task.h b/components/esp32/include/esp_task.h index f90e14a0c3..2f01e61016 100644 --- a/components/esp32/include/esp_task.h +++ b/components/esp32/include/esp_task.h @@ -35,21 +35,23 @@ /* controller */ #define ESP_TASK_BT_CONTROLLER_PRIO (ESP_TASK_PRIO_MAX - 2) #ifdef CONFIG_NEWLIB_NANO_FORMAT -#define BT_TASK_EXTRA_STACK_SIZE (0) +#define TASK_EXTRA_STACK_SIZE (0) #else -#define BT_TASK_EXTRA_STACK_SIZE (512) +#define TASK_EXTRA_STACK_SIZE (512) #endif -#define ESP_TASK_BT_CONTROLLER_STACK (3584 + BT_TASK_EXTRA_STACK_SIZE) + +#define BT_TASK_EXTRA_STACK_SIZE TASK_EXTRA_STACK_SIZE +#define ESP_TASK_BT_CONTROLLER_STACK (3584 + TASK_EXTRA_STACK_SIZE) /* idf task */ #define ESP_TASK_TIMER_PRIO (ESP_TASK_PRIO_MAX - 3) -#define ESP_TASK_TIMER_STACK CONFIG_TIMER_TASK_STACK_SIZE +#define ESP_TASK_TIMER_STACK (CONFIG_TIMER_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5) -#define ESP_TASKD_EVENT_STACK CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE +#define ESP_TASKD_EVENT_STACK (CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #define ESP_TASK_TCPIP_PRIO (ESP_TASK_PRIO_MAX - 7) -#define ESP_TASK_TCPIP_STACK CONFIG_TCPIP_TASK_STACK_SIZE +#define ESP_TASK_TCPIP_STACK (CONFIG_TCPIP_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1) -#define ESP_TASK_MAIN_STACK CONFIG_MAIN_TASK_STACK_SIZE +#define ESP_TASK_MAIN_STACK (CONFIG_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #endif diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index 97f93d6f8e..c0cf543049 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -308,11 +308,11 @@ endmenu # UDP config TCPIP_TASK_STACK_SIZE int "TCP/IP Task Stack Size" - default 2560 + default 2048 # for high log levels, tcpip_adapter API calls can end up # a few calls deep and logging there can trigger a stack overflow - range 2560 65536 if LOG_DEFAULT_LEVEL < 4 || NEWLIB_NANO_FORMAT - range 3072 65536 if LOG_DEFAULT_LEVEL >= 4 && !NEWLIB_NANO_FORMAT + range 2048 65536 if LOG_DEFAULT_LEVEL < 4 + range 2560 65536 if LOG_DEFAULT_LEVEL >= 4 help Configure TCP/IP task stack size, used by LWIP to process multi-threaded TCP/IP operations. Setting this stack too small will result in stack overflow crashes.