freertos: increase configMINIMAL_STACK_SIZE when building with -O0

FreeRTOS scheduler uses additional stack space, as in some functions
variables are placed onto the stack instead of registers.

This issue resulted in occasional stack overflows in dport task, when
compiling at -O0 optimization level.

- Increase the configMINIMAL_STACK_SIZE to 1kB.
- Enable the watchpoint at the end of stack in CI startup test for
  this optimization level.
This commit is contained in:
Ivan Grokhotkov 2020-06-02 18:51:16 +02:00
parent c0ed9349b0
commit f4ea9d4cea
2 changed files with 7 additions and 3 deletions

View file

@ -181,11 +181,14 @@ int xt_clock_freq(void) __attribute__((deprecated));
#define configMAX_PRIORITIES ( 25 )
#endif
#ifndef CONFIG_APPTRACE_ENABLE
#define configMINIMAL_STACK_SIZE 768
#else
#if defined(CONFIG_APPTRACE_ENABLE)
/* apptrace module requires at least 2KB of stack per task */
#define configMINIMAL_STACK_SIZE 2048
#elif defined(CONFIG_COMPILER_OPTIMIZATION_NONE)
/* with optimizations disabled, scheduler uses additional stack */
#define configMINIMAL_STACK_SIZE 1024
#else
#define configMINIMAL_STACK_SIZE 768
#endif
#ifndef configIDLE_TASK_STACK_SIZE

View file

@ -1 +1,2 @@
CONFIG_COMPILER_OPTIMIZATION_NONE=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y