Skip to content

Commit

Permalink
Increase background stack size to fix overflows with debug profile
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecoutant committed Apr 10, 2019
1 parent ffe9ddf commit ca4a5cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions rtos/TARGET_CORTEX/mbed_rtx_conf.h
Expand Up @@ -45,10 +45,18 @@
#else
#define EXTRA_IDLE_STACK 0
#endif

// Increase the idle thread stack size when debug is enabled
#if defined(MBED_DEBUG)
#define EXTRA_IDLE_STACK_DEBUG MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE_DEBUG_EXTRA
#else
#define EXTRA_IDLE_STACK_DEBUG 0
#endif

#ifdef MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_APP_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK)
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_APP_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK + EXTRA_IDLE_STACK_DEBUG)
#else
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK)
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK + EXTRA_IDLE_STACK_DEBUG)
#endif

#define OS_DYNAMIC_MEM_SIZE 0
Expand Down
4 changes: 4 additions & 0 deletions rtos/mbed_lib.json
Expand Up @@ -21,6 +21,10 @@
"idle-thread-stack-size-tickless-extra": {
"help": "Additional size to add to the idle thread when tickless is enabled and LPTICKER_DELAY_TICKS is used",
"value": 256
},
"idle-thread-stack-size-debug-extra": {
"help": "Additional size to add to the idle thread when tickless is enabled and LPTICKER_DELAY_TICKS is used",
"value": 256
}
},
"macros": ["_RTE_"],
Expand Down

0 comments on commit ca4a5cb

Please sign in to comment.