Skip to content

rtos: Improve CMSIS-RTOSv2 app compatibility #12736

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, 2020
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
32 changes: 32 additions & 0 deletions rtos/source/TARGET_CORTEX/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,38 @@
"idle-thread-stack-size-debug-extra": {
"help": "Additional size to add to the idle thread when code compilation optimisation is disabled",
"value": 0
},
"thread-num": {
"help": "Maximum number of CMSIS-RTOSv2 object-pool threads that can be active at the same time",
"value": 0
},
"thread-user-stack-size": {
"help": "The total memory available for all CMSIS-RTOSv2 object-pool thread stacks combined",
"value": 0
},
"timer-num": {
"help": "Maximum number of CMSIS-RTOSv2 object-pool timers that can be active at the same time",
"value": 0
},
"evflags-num": {
"help": "Maximum number of CMSIS-RTOSv2 object-pool event flag objects that can be active at the same time",
"value": 0
},
"mutex-num": {
"help": "Maximum number of CMSIS-RTOSv2 object-pool mutexes that can be active at the same time",
"value": 0
},
"semaphore-num": {
"help": "Maximum number of CMSIS-RTOSv2 object-pool semaphores that can be active at the same time",
"value": 0
},
"msgqueue-num": {
"help": "Maximum number of CMSIS-RTOSv2 object-pool message queues that can be active at the same time",
"value": 0
},
"msgqueue-data-size": {
"help": "The total memory available for all CMSIS-RTOSv2 object-pool message queues combined",
"value": 0
}
},
"macros": ["_RTE_"],
Expand Down
56 changes: 56 additions & 0 deletions rtos/source/TARGET_CORTEX/mbed_rtx_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,62 @@
#define OS_IDLE_THREAD_STACK_SIZE (MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE + EXTRA_IDLE_STACK + EXTRA_IDLE_STACK_DEBUG)
#endif

// The number of threads available to applications that need to use
// CMSIS-RTOSv2 Object-specific Memory Pools
#if MBED_CONF_RTOS_THREAD_NUM > 0
#define OS_THREAD_OBJ_MEM 1
#define OS_THREAD_NUM MBED_CONF_RTOS_THREAD_NUM
#endif

// The total amount of memory for all thread stacks combined available to
// applications that need to use CMSIS-RTOSv2 Object-specific Memory Pools for
// threads
#if MBED_CONF_RTOS_THREAD_USER_STACK_SIZE > 0
#define OS_THREAD_USER_STACK_SIZE MBED_CONF_RTOS_THREAD_USER_STACK_SIZE
#endif

// The number of timers available to applications that need to use CMSIS-RTOSv2
// Object-specific Memory Pools
#if MBED_CONF_RTOS_TIMER_NUM > 0
#define OS_TIMER_OBJ_MEM 1
#define OS_TIMER_NUM MBED_CONF_RTOS_TIMER_NUM
#endif

// The number of event flag objects available to applications that need to use
// CMSIS-RTOSv2 Object-specific Memory Pools
#if MBED_CONF_RTOS_EVFLAGS_NUM > 0
#define OS_EVFLAGS_OBJ_MEM 1
#define OS_EVFLAGS_NUM MBED_CONF_RTOS_EVFLAGS_NUM
#endif

// The number of mutexes available to applications that need to use
// CMSIS-RTOSv2 Object-specific Memory Pools
#if MBED_CONF_RTOS_MUTEX_NUM > 0
#define OS_MUTEX_OBJ_MEM 1
#define OS_MUTEX_NUM MBED_CONF_RTOS_MUTEX_NUM
#endif

// The number of semaphores available to applications that need to use
// CMSIS-RTOSv2 Object-specific Memory Pools
#if MBED_CONF_RTOS_SEMAPHORE_NUM > 0
#define OS_SEMAPHORE_OBJ_MEM 1
#define OS_SEMAPHORE_NUM MBED_CONF_RTOS_SEMAPHORE_NUM
#endif

// The number of message queues available to applications that need to use
// CMSIS-RTOSv2 Object-specific Memory Pools
#if MBED_CONF_RTOS_MSGQUEUE_NUM > 0
#define OS_MSGQUEUE_OBJ_MEM 1
#define OS_MSGQUEUE_NUM MBED_CONF_RTOS_MSGQUEUE_NUM
#endif

// The total amount of memory for all message queues combined available to
// applications that need to use CMSIS-RTOSv2 Object-specific Memory Pools for
// message queues
#if MBED_CONF_RTOS_MSGQUEUE_DATA_SIZE > 0
#define OS_MSGQUEUE_DATA_SIZE MBED_CONF_RTOS_MSGQUEUE_DATA_SIZE
#endif

#define OS_DYNAMIC_MEM_SIZE 0

#if defined(OS_TICK_FREQ) && (OS_TICK_FREQ != 1000)
Expand Down