From 8ebea6f689e3301b3b3c93fbfbcf92d918535f05 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Mon, 6 Dec 2021 12:27:16 +0800 Subject: [PATCH] bugfix (freertos): Changed minimal stack size to regard watchpoint usage --- .../esp_additions/include/freertos/FreeRTOSConfig.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h b/components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h index 20653f32ce..6bb8189459 100644 --- a/components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h +++ b/components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h @@ -166,10 +166,19 @@ #define configSTACK_OVERHEAD_APPTRACE 0 #endif +/* Stack watchpoint decreases minimum usable stack size by up to 60 bytes. + See FreeRTOS FREERTOS_WATCHPOINT_END_OF_STACK option in Kconfig. */ +#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK +#define configSTACK_OVERHEAD_WATCHPOINT 60 +#else +#define configSTACK_OVERHEAD_WATCHPOINT 0 +#endif + #define configSTACK_OVERHEAD_TOTAL ( \ configSTACK_OVERHEAD_CHECKER + \ configSTACK_OVERHEAD_OPTIMIZATION + \ - configSTACK_OVERHEAD_APPTRACE \ + configSTACK_OVERHEAD_APPTRACE + \ + configSTACK_OVERHEAD_WATCHPOINT \ ) #define configMINIMAL_STACK_SIZE (768 + configSTACK_OVERHEAD_TOTAL)