Increase background stack size to fix overflows

On platforms using both tickless and the low power ticker wrapper
so much of the background stack is used that it overflows. To
ensure the background thread's stack doesn't overflow increase this
size by 256 bytes when tickless is enabled. Worst case usage
on the NUCLEO_F476RG was recorded at 656 when tickless is
turned on so this increased size should safely prevent overflows.
pull/8551/head
Russ Butler 2018-10-25 15:01:59 -05:00
parent b18c819837
commit 9613e0ffbd
2 changed files with 13 additions and 3 deletions

View File

@ -39,10 +39,16 @@
#define OS_TIMER_THREAD_STACK_SIZE MBED_CONF_RTOS_TIMER_THREAD_STACK_SIZE
#endif
#ifdef MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
#define OS_IDLE_THREAD_STACK_SIZE MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
// Increase the idle thread stack size when tickless is enabled
#if defined(MBED_TICKLESS) && defined(LPTICKER_DELAY_TICKS) && (LPTICKER_DELAY_TICKS > 0)
#define EXTRA_IDLE_STACK MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE_TICKLESS_EXTRA
#else
#define OS_IDLE_THREAD_STACK_SIZE MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE
#define EXTRA_IDLE_STACK 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)
#else
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK)
#endif
#define OS_DYNAMIC_MEM_SIZE 0

View File

@ -17,6 +17,10 @@
"thread-stack-size": {
"help": "The default stack size of new threads",
"value": 4096
},
"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
}
},
"macros": ["_RTE_"],