diff --git a/rtos/mbed_lib.json b/rtos/mbed_lib.json index c0d9e20bdc8..359a6ab8a16 100644 --- a/rtos/mbed_lib.json +++ b/rtos/mbed_lib.json @@ -1,6 +1,7 @@ { "name": "rtos", "config": { - "present": 1 + "present": 1, + "default_stack_size": "(WORDS_STACK_SIZE*4)" } } diff --git a/rtos/rtx/TARGET_CORTEX_A/cmsis_os.h b/rtos/rtx/TARGET_CORTEX_A/cmsis_os.h index 5ead34c9932..b1a6c770f44 100644 --- a/rtos/rtx/TARGET_CORTEX_A/cmsis_os.h +++ b/rtos/rtx/TARGET_CORTEX_A/cmsis_os.h @@ -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 diff --git a/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h b/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h index ac052ff82b8..ed9aacb98b1 100644 --- a/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h +++ b/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h @@ -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])