Skip to content

Add RTOS configuration for default stack size #2646

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

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 2 additions & 1 deletion rtos/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "rtos",
"config": {
"present": 1
"present": 1,
"default_stack_size": "(WORDS_STACK_SIZE*4)"
}
}
6 changes: 5 additions & 1 deletion rtos/rtx/TARGET_CORTEX_A/cmsis_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ used throughout the whole project.
# define WORDS_STACK_SIZE 128
#endif

#define DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
#ifndef MBED_CONF_RTOS_DEFAULT_STACK_SIZE
#define MBED_CONF_RTOS_DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
#endif

#define DEFAULT_STACK_SIZE MBED_CONF_RTOS_DEFAULT_STACK_SIZE

/// \note MUST REMAIN UNCHANGED: \b osFeature_xxx shall be consistent in every CMSIS-RTOS.
#define osFeature_MainThread 1 ///< main thread 1=main can be thread, 0=not available
Expand Down
6 changes: 5 additions & 1 deletion rtos/rtx/TARGET_CORTEX_M/cmsis_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@

#endif

#define DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
#ifndef MBED_CONF_RTOS_DEFAULT_STACK_SIZE
#define MBED_CONF_RTOS_DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
#endif

#define DEFAULT_STACK_SIZE MBED_CONF_RTOS_DEFAULT_STACK_SIZE

#define osCMSIS 0x10002U ///< CMSIS-RTOS API version (main [31:16] .sub [15:0])

Expand Down