Keil RTX v5
Keil RTX v5 is a real-time operating system (RTOS). It is the reference implementation of the CMSIS-RTOS v2 API.
If you are new to CMake and the Open IoT SDK, you are advised to familiarized yourself with How to create an application and use the Open IoT SDK before continuing.
Fetching
In your application's CMakeLists.txt
, include cmsis-5
in the IOTSDK_FETCH_LIST
variable, alongside any other components you need to fetch:
Configuration
In your application's directory, create a cmsis-config/RTE_Components.h
file for the Keil RTX v5 configuration. You can either leave the RTE_Components.h
file empty, or define any configuration macros you want to override in the file. Refer to the list of configuration macros.
In your application's CMakeLists.txt
, add cmsis-config
(which contains RTE_Components.h
) to the include directories of the target named cmsis-config
:
RTE_Components.h
is the user configuration header for all CMSIS components including Keil RTX v5, and it must exist (if your application uses any CMSIS components) but can be empty.
Linking
Link the library cmsis-rtos-api
to the library cmsis-rtx
:
cmsis-rtos-api
provides the API declaration only, whereascmsis-rtx
is a concrete implementation (definition) of the API. Without thistarget_link_libraries()
directive, libraries that depend oncmsis-rtos-api
may fail to pick up the definition and causeundefined reference
errors.
Finally, link your application to the library cmsis-rtos-api
, alongside any other libraries you need:
Examples
To see the full context of where to put each of the above code snippet in CMakeLists.txt
, as well as how to call the API from your application, you are advised to take a look at the examples showing how to use Keil RTX v5.
Documentation
For more details of the API usage and the available configuration options, see CMSIS-RTOS v2 Documentation and RTX v5 Implementation.