News Item
13 Mar 2017
CMSIS-RTOS Choices: Keil RTX or FreeRTOS
ARM extends CMSIS compliant real-time operating systems for the
microcontroller industry with CMSIS-RTOS
v2 and the adoption of Keil RTX
and FreeRTOS.
CMSIS-RTOS is a generic RTOS interface for ARM® Cortex®-M
processor-based devices. It provides a standardized API for software
components that require RTOS functionality and gives therefore
serious benefits to the users and the software industry:
-
CMSIS-RTOS provides basic features that is required in many
embedded applications.
-
The unified feature set of the CMSIS-RTOS reduces learning
efforts and simplifies sharing of software components.
-
Middleware components that use the CMSIS-RTOS interface are
easier to adapt.
The CMSIS-RTOS
v2 API extends the first implementation and addresses the
following new requirements:
-
Dynamic object creation no longer requires static memory,
static memory buffers are now optional.
-
Support for TrustZone technology on Cortex-M provides a
secure and non-secure execution area.
-
Provisions for message passing in multi-core systems and C++
run-time environments.
-
C interface which is binary compatible across ABI compatible
compilers.
RTOS choices with compatible API
A lock-in into a specific RTOS kernel introduces some project risk
as requirements may change over the project life-cycle, for example,
when deterministic interrupt response or support for a new processor
core is required. ARM offers therefore various implementations of the
CMSIS-RTOS as shown in the following picture.

When using the CMSIS-RTOS API, the underlying RTOS kernel can be
easily replaced. Also migration of CMSIS-RTOS v1 to CMSIS-RTOS v2 is
simplified with the compatibility layer.
-
Keil RTX4 is available since 2005 and the basis
for the original CMSIS-RTOS v1 reference implementation. It is also
part of the current mbed OS scheduler.
-
Keil RTX5 is a new ground-up implementation
that natively supports the CMSIS-RTOS v2 API. The kernel supports
all Cortex-M processors (including Cortex-M23/M33) and the
compatibility layer provides CMSIS-RTOS v1 compliance. RTX5 uses
Cortex-M hardware features and never disables interrupts during
kernel execution (except for Cortex-M0/M0+).
-
FreeRTOS is widely adopted to different processors and
is now available with a CMSIS-RTOS v2 API interface. CMSIS-RTOS v1
based applications may use the compatibility layer.
Select RTOS in MDK
All CMSIS-RTOS implementations are provided as Software Pack that
simplifies project integration. Keil RTX4 and RTX5 are part of the
CMSIS Software Pack. The FreeRTOS implementation is a separate
software pack available from www.keil.com/pack, the Pack
Installer, or GitHub. The picture below shows the selection of
FreeRTOS with the CMSIS-RTOS compliant API or the a native FreeRTOS
API. When using the CMSIS-RTOS2 configuration file, the native
FreeRTOS API is still available which allows project migration over
time.

RTOS Kernel Awareness and Event Recorder
The CMSIS-RTOS implementations are supported in the uVision
Debugger with the Component Viewer for kernel awareness and the
Event Recorder for analysing the dynamic run-time
behaviour. The picture below shows FreeRTOS debugging using the
MDK-Lite edition and the uVision Debugger in simulation mode - no
target hardware is required.

Getting started with CMSIS-RTOS