/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
/**
\mainpage
The CMSIS-RTOS API Version 2 (CMSIS-RTOS2) 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-RTOS2 provides basic features that are required in many applications.
- The unified feature set of the CMSIS-RTOS2 reduces learning efforts and simplifies sharing of software components.
- Middleware components that use the CMSIS-RTOS2 are RTOS agnostic and are easier to adapt.
- Standard project templates of the CMSIS-RTOS2 may be shipped with freely available CMSIS-RTOS2 implementations.
\note The CMSIS-RTOS API Version 2 defines a minimum feature set. Implementations with extended features may be provided by
the RTOS vendors.
The CMSIS-RTOS2 manages the resources of the microcontroller system and implements the concept of parallel threads that run
concurrently.
Applications frequently require several concurrent activities. CMSIS-RTOS2 can manage multiple concurrent activities at the
time when they are needed. Each activity gets a separate thread which executes a specific task and this simplifies the
overall program structure. The CMSIS-RTOS2 system is scalable and additional threads can be added easily at a later time.
Threads have a priority allowing faster execution of time-critical parts of a user application.
The CMSIS-RTOS2 offers services needed in many real-time applications, for example, periodical activation of timer functions,
memory management, and message exchange between threads with time limits.
The CMSIS-RTOS2 addresses the following new requirements:
- Dynamic object creation no longer requires static memory, static memory buffers are now optional.
- Support for ARMv8-M architecture that provides a secure and non-secure state of code execution.
- Provisions for message passing in multi-core systems.
- Full support of C++ run-time environments.
- C interface which is binary compatible across
ABI compatible compilers.
As a consequence of these requirements the CMSIS-RTOS2 has the following fundamental modifications:
- The functions osXxxxNew replace osXxxxCreate functions; osXxxxNew and osXxxxDelete create and destroy objects.
- The C function \c main is no longer started as a thread (this was an optional feature in CMSIS-RTOS v1).
- Functions that return osEvent have been replaced.
CMSIS-RTOS2 provides an translation layer for the CMSIS-RTOS API v1. It
is possible to intermix CMSIS-RTOS API Version 2 and CMSIS-RTOS API Version 1 within the same application. Over time, you may
migrate to the new API as explained in \ref os2Migration.
CMSIS-RTOS2 is not POSIX compliant, but has provisions to enable a C++11/C++14 interface.
The following sections provide further details about CMSIS-RTOS2 and the RTX reference implementation.
- \subpage rtos_revisionHistory documents changes made in each version for CMSIS-RTOS API v2 and RTX v5.
- \subpage genRTOS2IF provides an overview about the CMSIS-RTOS API v2.
- \subpage functionOverview lists the CMSIS-RTOS2 API functions and the header file cmsis_os2.h.
- \subpage rtosValidation describes the validation suite that is publicly available.
- \subpage os2Migration shows how to use CMSIS-RTOS2 in existing projects and lists function differences to CMSIS-RTOS v1.
- \subpage rtx5_impl provides general information about the operation and usage of RTX v5.
| Version |
Description |
| V2.1.2 |
Additional functions allowed to be called from Interrupt Service Routines:
- \ref osKernelGetInfo, \ref osKernelGetState
|
| V2.1.1 |
Additional functions allowed to be called from Interrupt Service Routines:
- \ref osKernelGetTickCount, \ref osKernelGetTickFreq
Changed Kernel Tick type to uint32_t:
- updated: \ref osKernelGetTickCount, \ref osDelayUntil
|
| V2.1.0 |
Support for critical and uncritical sections (nesting safe):
- updated: \ref osKernelLock, \ref osKernelUnlock
- added: \ref osKernelRestoreLock
Updated \ref CMSIS_RTOS_ThreadFlagsMgmt "Thread Flags" and \ref CMSIS_RTOS_EventFlags "Event Flags":
- changed flags parameter and return type from int32_t to uint32_t
|
| V2.0.0 |
New API Version 2.0 available.
- See \ref rtos_api2 for a detailed function reference.
- See \ref os2Migration for details on the migration process from API Version 1.
|
| V1.02 - only documentation changes |
Added: Overview of the \ref rtosValidation "CMSIS-RTOS Validation" Software Pack.\n
Clarified: Behavior of \ref CMSIS_RTOS_TimeOutValue.
|
| V1.02 |
Added: New control functions for short timeouts in microsecond resolution \b osKernelSysTick,
\b osKernelSysTickFrequency, \b osKernelSysTickMicroSec.\n
Removed: osSignalGet.
|
fv
| V1.01 |
Added capabilities for C++, kernel initialization and object deletion.\n
Prepared for C++ class interface. In this context to \em const attribute has been moved from osXxxxDef_t typedefs to
the osXxxxDef macros.\n
Added: \ref osTimerDelete, \ref osMutexDelete, \ref osSemaphoreDelete.\n
Added: \ref osKernelInitialize that prepares the kernel for object creation.\n
|
|
V1.00 |
First official Release.\n
Added: \ref osKernelStart; starting 'main' as a thread is now an optional feature.\n
Semaphores have now the standard behavior.\n
\b osTimerCreate does no longer start the timer. Added: \ref osTimerStart (replaces osTimerRestart).\n
Changed: osThreadPass is renamed to \ref osThreadYield.
|
| V0.02 |
Preview Release. |
\section RTX5RevisionHistory CMSIS-RTOS RTX Version 5
| Version |
Description |
| V5.2.3 |
- Based on CMSIS-RTOS API V2.1.2.
- Added TrustZone Module Identifier configuration for Idle and Timer Thread.
- Moved SVC/PendSV handler priority setup from osKernelInitialize to osKernelStart (User Priority Grouping can be updated after osKernelInitialize but before osKernelStart).
- Corrected SysTick and PendSV handlers for ARMv8-M Baseline.
- Corrected memory allocation for stack and data when "Object specific Memory allocation" configuration is used.
- Added support for ARMv8-M IAR compiler.
|
| V5.2.2 |
- Corrected IRQ and SVC exception handlers for Cortex-A.
|
| V5.2.1 |
- Corrected SysTick and SVC Interrupt Priority for Cortex-M.
|
| V5.2.0 |
- Based on CMSIS-RTOS API V2.1.1.
- Added support for for Cortex-A.
- Using OS Tick API for RTX Kernel Timer Tick.
- Fixed potential corruption of terminated threads list.
- Corrected MessageQueue to use actual message length (before padding).
- Corrected parameters for ThreadEnumerate and MessageQueueInserted events.
- Timer Thread creation moved to osKernelStart.
|
| V5.1.0 |
- Based on CMSIS-RTOS API V2.1.0.
- Added support for Event recording.
- Added support for IAR compiler.
- Updated configuration files: RTX_Config.h for the configuration settings and RTX_config.c for implementing the \ref rtx5_specific.
- osRtx name-space for RTX specific symbols.
|
| V5.0.0 |
Initial release compliant to CMSIS-RTOS2.\n
|
*/
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
/**
\page genRTOS2IF Generic RTOS Interface
CMSIS-RTOS2 is a generic API that is agnostic of the underlying RTOS kernel. Application programmers call CMSIS-RTOS2 API
functions in the user code to ensure maximum portability from one RTOS to another. Middleware using CMSIS-RTOS2 API takes
advantages of this approach by avoiding unnecessary porting efforts.
\image html "API_Structure.png" "CMSIS-RTOS API Structure"
A typical CMSIS-RTOS2 API implementation interfaces to an existing real-time kernel. The CMSIS-RTOS2 API provides the
following attributes and functionalities:
- Function names, identifiers, and parameters are descriptive and easy to understand. The functions are powerful and
flexible which reduces the number of functions exposed to the user.
- \ref CMSIS_RTOS_ThreadMgmt allows you to define, create, and control threads.
- Interrupt Service Routines (ISR) can \ref CMSIS_RTOS_ISR_Calls "call some CMSIS-RTOS functions". When a CMSIS-RTOS
function cannot be called from an ISR context, it rejects the invocation and returns an error code.
- Three different event types support communication between multiple threads and/or ISR:
- \ref CMSIS_RTOS_ThreadFlagsMgmt "Thread Flags": may be used to indicate specific conditions to a thread.
- \ref CMSIS_RTOS_EventFlags "Event Flags": may be used to indicate events to a thread or ISR.
- \ref CMSIS_RTOS_Message "Messages": can be sent to a thread or an ISR. Messages are buffered in a queue.
- \ref CMSIS_RTOS_MutexMgmt and \ref CMSIS_RTOS_SemaphoreMgmt are incorporated.
- CPU time can be scheduled with the following functionalities:
- A \a timeout parameter is incorporated in many CMSIS-RTOS functions to avoid system lockup. When a timeout is specified,
the system waits until a resource is available or an event occurs. While waiting, other threads are scheduled.
- The \ref osDelay and \ref osDelayUntil functions put a thread into the \b WAITING state for a specified period of time.
- The \ref osThreadYield provides co-operative thread switching and passes execution to another thread of the same
priority.
- \ref CMSIS_RTOS_TimerMgmt functions are used to trigger the execution of functions.
The CMSIS-RTOS2 API is designed to optionally incorporate multi-processor systems and/or access protection via the Cortex-M
Memory Protection Unit (MPU).
In some RTOS implementations threads may execute on different processors, thus \b message queues may reside in shared memory
resources.
The CMSIS-RTOS2 API encourages the software industry to evolve existing RTOS implementations. RTOS implementations can be
different and optimized in various aspects towards the Cortex-M processors. Optional features may be for example
- Support of the Cortex-M Memory Protection Unit (MPU).
- Support of multi-processor systems.
- Support of a DMA controller.
- Deterministic context switching.
- Round-robin context switching.
- Deadlock avoidance, for example with priority inversion.
- Zero interrupt latency by using ARMv7-M instructions LDREX and STREX.
\section usingOS2 Using a CMSIS-RTOS2 Implementation
A CMSIS-RTOS2 implementation is typically provided as a library. To add the RTOS functionality to an existing CMSIS-based
application, the RTOS library (and typically one or more configuration files) needs to be added. There is a single new header
file %cmsis_os2.h available. This is the only header file required for a completely portable application. In such a case,
user provided memory for control blocks, objects data and thread stack cannot be used. Alternatively, you can include an
implementation specific header file (for example rtx_os.h) which provides definitions also for resource allocation (such as
size of control blocks, required memory for object data and thread stack). This is optional and implies that the application
code is not completely portable.
\image html "CMSIS_RTOS_Files.png" "CMSIS-RTOS File Structure"
Once the files are added to a project, the user can start working with the CMSIS-RTOS functions. A code example is provided
below:
| Directory |
Content |
| Include |
The include file for CMSIS-RTOS API v2. cmsis_os2.h is the central include file for user applications. |
| Template |
CMSIS-RTOS API template source and header file. |
| RTX |
Directory with RTX specific files and folders. Also contains the component viewer description file. |
| RTX/Config |
CMSIS-RTOS RTX configuration files %RTX_Config.h and %RTX_Config.c. |
| RTX/Examples |
Example projects that can be directly used in development tools. |
| RTX/Include |
RTX v5 specific include files. |
| RTX/Include1 |
CMSIS-RTOS v1 API header file. |
| RTX/Library |
Pre-built libraries (see next table for details). |
| RTX/Source |
Source code that can be used with ARMCC and GCC. |
| RTX/Template |
User code templates for creating application projects with CMSIS-RTOS RTX v5. |
\section libFiles RTX v5 Library Files
The CMSIS-RTOS RTX Library is available pre-compiled for ARMCC and GCC compilers and supports all Cortex-M
processor variants in every configuration, including ARM Cortex-M23 and Cortex-M33.
| Library File |
Processor Configuration |
| Library/ARM/RTX_CM0.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M0 and M1, little-endian. |
| Library/ARM/RTX_CM3.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M3, M4, and M7 without FPU, little-endian. |
| Library/ARM/RTX_CM4F.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, Cortex-M4 and M7 with FPU, little-endian. |
| Library/ARM/RTX_V8MB.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, ARMv8-M baseline. |
| Library/ARM/RTX_V8MBN.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, ARMv8-M baseline, non-secure. |
| Library/ARM/RTX_V8MM.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, ARMv8-M mainline. |
| Library/ARM/RTX_V8MMF.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, ARMv8-M mainline with FPU. |
| Library/ARM/RTX_V8MMFN.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, ARMv8-M mainline with FPU, non-secure. |
| Library/ARM/RTX_V8MMN.lib |
CMSIS-RTOS RTX Library for ARMCC Compiler, ARMv8-M mainline, non-secure. |
| Library/GCC/libRTX_CM0.a |
CMSIS-RTOS libRTX Library for GCC Compiler, Cortex-M0 and M1, little-endian. |
| Library/GCC/libRTX_CM3.a |
CMSIS-RTOS libRTX Library for GCC Compiler, Cortex-M3, M4, and M7 without FPU, little-endian. |
| Library/GCC/libRTX_CM4F.a |
CMSIS-RTOS libRTX Library for GCC Compiler, Cortex-M4 and M7 with FPU, little-endian. |
| Library/GCC/libRTX_V8MB.a |
CMSIS-RTOS libRTX Library for GCC Compiler, ARMv8-M baseline. |
| Library/GCC/libRTX_V8MBN.a |
CMSIS-RTOS libRTX Library for GCC Compiler, ARMv8-M baseline, non-secure. |
| Library/GCC/libRTX_V8MM.a |
CMSIS-RTOS libRTX Library for GCC Compiler, ARMv8-M mainline. |
| Library/GCC/libRTX_V8MMF.a |
CMSIS-RTOS libRTX Library for GCC Compiler, ARMv8-M mainline with FPU. |
| Library/GCC/libRTX_V8MMFN.a |
CMSIS-RTOS libRTX Library for GCC Compiler, ARMv8-M mainline with FPU, non-secure. |
| Library/GCC/libRTX_V8MMN.a |
CMSIS-RTOS libRTX Library for GCC Compiler, ARMv8-M mainline, non-secure. |
*/
/* ========================================================================================================================== */
/**
\page technicalData5 Technical Data
\section technicalData_Toolchains Supported Toolchains
Keil RTX5 is developed and tested using the common toolchains and development environments.
\subsection technicalData_Toolchain_ARM 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: