CMSIS-RTOS2: Technical Data

| CMSIS-RTOS2 Version 2.1.1 Real-Time Operating System: API and RTX Reference Implementation

- Main Page
- Usage and Description
- Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Technical Data

# Supported Toolchains

Keil RTX5 is developed and tested using the common toolchains and development environments.

## ARM Compiler (ARM/Keil MDK, uVision5)

Major parts of RTX5 are developed and optimized using ARM Compiler and ARM/Keil MDK. The current release is tested with the following versions:

- ARM Compiler 5.06 Update 5 (Build 528)
- ARM Compiler 6.6.1 (Long Term Maintenance)
- ARM Compiler 6.7
- RTOS-aware debugging with uVision 5.24

## IAR Embedded Workbench

RTX5 has been ported to fully support IAR Embedded Workbench. The following releases are known to work:

- IAR Embedded Workbench 7.7 (community report)
- IAR Embedded Workbench 7.80.4
- IAR Embedded Workbench 8.10

## GNU Compiler Collection

RTX5 has also been ported to support GCC, maintenance mainly relays on community contribution. Active development is currently tested with:

- GCC 5.4 Release Series

# Control Block Sizes

Keil RTX5 specific control block definitions (including sizes) as well as memory pool and message queue memory requirements are defined in the RTX5 header file:

/// Control Block sizes
#define osRtxThreadCbSize sizeof(osRtxThread_t)
#define osRtxTimerCbSize sizeof(osRtxTimer_t)
#define osRtxEventFlagsCbSize sizeof(osRtxEventFlags_t)
#define osRtxMutexCbSize sizeof(osRtxMutex_t)
#define osRtxSemaphoreCbSize sizeof(osRtxSemaphore_t)
#define osRtxMemoryPoolCbSize sizeof(osRtxMemoryPool_t)
#define osRtxMessageQueueCbSize sizeof(osRtxMessageQueue_t)
/// Memory size in bytes for Memory Pool storage.
/// \param block_count maximum number of memory blocks in memory pool.
/// \param block_size memory block size in bytes.
#define osRtxMemoryPoolMemSize(block_count, block_size) \
(4*(block_count)*(((block_size)+3)/4))
/// Memory size in bytes for Message Queue storage.
/// \param msg_count maximum number of messages in queue.
/// \param msg_size maximum message size in bytes.
#define osRtxMessageQueueMemSize(msg_count, msg_size) \
(4*(msg_count)*(3+(((msg_size)+3)/4)))

If you are using a Global Memory Pool to allocate memory for the RTOS objects, you need to know the size that is required for each object in case of errors. Currently, the control block sizes are as follows (subject to change without notification):

Type | Control block size in bytes
--- | ---
Thread | 68
Timer | 32
Event Flags | 16
Mutex | 28
Semaphore | 16
Memory Pool | 36
Message Queue | 52

The size of the memory that is required for memory pool and message queue data storage can be determined from the macros stated above.