CMSIS-RTOS2: Create an RTX5 Project

| 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
Create an RTX5 Project

The steps to create a microcontroller application using RTX5 are:

- Create a new project and select a microcontroller device.

- In the Manage Run-Time Environment window, select CMSIS::CORE and CMSIS::RTOS2 (API)::Keil RTX5. You can choose to either add RTX as a library (Variant: Library) or to add the full source code (Variant: Source - required if using the Event Recorder):

- If the Validation Output requires other components to be present, try to use the Resolve button.

- Click OK. In the Project window, you will see the files that have been automatically added to you project, such as RTX_Config.h, RTX_Config.c, the library or the source code files, as well as the system and startup files:

- If using the Variant: Source as statet above, you have to assure to use at least C99 compiler mode (Project Options -> C/C++ -> C99 Mode).

- You can add template files to the project by right-clicking on Source Group 1 and selecting Add New Item to 'Source Group 1'. In the new window, click on User Code Template. On the right-hand side you will see all available template files for CMSIS-RTOS RTX:

- Configure RTX5 to the application's needs using the RTX_Config.h file.

# Additional requirements for RTX on Cortex-A

Cortex-A based microcontrollers are less unified with respect to the interrupt and timer implementations used compared to M-class devices. Thus RTX requires additional components when an A-class device is used, namely IRQ Controller (API) and OS Tick (API) implementations.

The default implementations provided along with CMSIS are

- ARM Generic Interrupt Controller (GIC)
- ARM Cortex-A5, Cortex-A9 Private Timer (PTIM)
- ARM Cortex-A7 Generic Physical Timer (GTIM)

For devices not implementing GIC, PTIM nor GTIM please refer to the according device family pack and select the proper implementations.

# Add support for RTX specific functions

If you require some of the RTX specific functions in your application code, #include the header file rtx_os.h. This enables low-power and tick-less operation modes.

# Add Event Recorder Visibility

- To use the Event Recorder together with RTX5, select the software component Compiler:Event Recorder.
- Select the Source variant of the software component CMSIS:RTOS2 (API):Keil RTX5.
  Component selection for Event Recorder
- Call the function EventRecorderInitialize() in your application code (ideally in `main()`).
- Build the application code and download it to the debug hardware.

Once the target application generates event information, it can be viewed in the µVision debugger using the Event Recorder.