Skip to content

Commit ca4a5cb

Browse files
committed
Increase background stack size to fix overflows with debug profile
1 parent ffe9ddf commit ca4a5cb

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

rtos/TARGET_CORTEX/mbed_rtx_conf.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,18 @@
4545
#else
4646
#define EXTRA_IDLE_STACK 0
4747
#endif
48+
49+
// Increase the idle thread stack size when debug is enabled
50+
#if defined(MBED_DEBUG)
51+
#define EXTRA_IDLE_STACK_DEBUG MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE_DEBUG_EXTRA
52+
#else
53+
#define EXTRA_IDLE_STACK_DEBUG 0
54+
#endif
55+
4856
#ifdef MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
49-
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_APP_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK)
57+
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_APP_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK + EXTRA_IDLE_STACK_DEBUG)
5058
#else
51-
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK)
59+
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK + EXTRA_IDLE_STACK_DEBUG)
5260
#endif
5361

5462
#define OS_DYNAMIC_MEM_SIZE 0

rtos/mbed_lib.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"idle-thread-stack-size-tickless-extra": {
2222
"help": "Additional size to add to the idle thread when tickless is enabled and LPTICKER_DELAY_TICKS is used",
2323
"value": 256
24+
},
25+
"idle-thread-stack-size-debug-extra": {
26+
"help": "Additional size to add to the idle thread when tickless is enabled and LPTICKER_DELAY_TICKS is used",
27+
"value": 256
2428
}
2529
},
2630
"macros": ["_RTE_"],

0 commit comments

Comments
 (0)