Skip to content

Increase background stack size to fix overflows with debug profile #10367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions rtos/TARGET_CORTEX/mbed_rtx_conf.h
Original file line number Diff line number Diff line change
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this line,
as I think that different calculation for idle size value depending on tickless and/or debug
is needed only if the user doesn't specify explicitly the needed and expected size.

@c1728p9

#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
10 changes: 10 additions & 0 deletions rtos/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,22 @@
"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 code compilation optimisation is disabled",
"value": 0
}
},
"macros": ["_RTE_"],
"target_overrides": {
"*": {
"target.boot-stack-size": "0x400"
},
"STM": {
"idle-thread-stack-size-debug-extra": 128
},
"STM32L1": {
"idle-thread-stack-size-debug-extra": 512
},
"MCU_NRF51": {
"target.boot-stack-size": "0x800"
Expand Down