CMSIS/RTX code is imported from the original CMSIS repository with the help of a Python script in the
Please note that Arm Mbed OS doesn't use any of the RTX memory models, which are based on static carveouts (memory pools). This approach is not ideal for platform operating systems, such as Mbed OS, because calculating required numbers of RTOS objects is impossible. To avoid declaring arbitrary large buffers carved out at compile time, limiting the amount of available memory, Mbed OS shifts the responsibility of supplying the backing memory to CMSIS-RTOS2 users.
Developers need to use the Mbed OS RTOS C++ API or supply backing memory for RTX objects to
os*New calls when using CMSIS-RTOS2 APIs directly. (Please consult CMSIS-RTOS2 documentation for API details.) The
mbed_rtos_storage.h header provides wrappers that you can use to secure required memory without exposing the code to RTX implementation details.
Mbed OS changes to RTX configuration all exist in a single file:
||4K||OS Stack size is set as
||768B||Timer thread stack is set as
||Idle thread stack size is set as
||Required to handle Mbed OS wrappers|
||0||RTX dynamic memory is disabled.|
||1000||Mbed OS Tickrate requires 1ms system tick.|
||0 or 1||Watermarking is enabled if
||0 or 1||We set it for 0 if uVisor is enabled, 1 otherwise.|
Due to differences in the Mbed OS and CMSIS directory structure, you can't import the original code directly. You should use the
importer.py and configuration file
cmsis_importer.json to import upstream CMSIS code.
Due to different use cases between Mbed OS and CMSIS, we modified the source code. We upstream our changes to the CMSIS repository, but in cases when they aren't compatible with CMSIS requirements, we maintain a small set of changes. We maintain changes as separate commits in
mbed-os, and SHAs are in the
commit_sha section of the