# Build an RTX5 RTOS application with Keil μVision

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx/)
- [Create and setup Keil MDK project](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx/create/)
- [Initialize the operating system](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx/initialize/)
- [Create RTOS threads](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx/threads/)
- [Build and run the application](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx/build_and_run/)
- [Using Event Recorder](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx/eventrecorder/)
- [Next Steps](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx/_next-steps/)

## About this Learning Path

| Skill level:   | Introductory          |
|-----------------|----------------------|
| Reading time:   | 30 min               |
| Last updated:   | 08 Jul 2026          |

| Author:         | Ronan Synnott, Arm [LinkedIn](https://linkedin.com/in/ronansynnott) |
|-----------------|-----------------------------------------------------------------------|
| Arm IP:         | [Cortex-M](https://support.arm.com/?tab=compute-ip&Product%20Type=Microcontrollers) |
| Tags:           | RTOS Fundamentals, RTOS, Keil RTX RTOS, Keil MDK, Arm Development Studio |

## Who is this for?

This is an introductory topic for software developers new to RTOS development.

## What will you learn?

Upon completion of this Learning Path, you will be able to:

- Implement a basic RTOS-based application

## Prerequisites

Before starting, you will need the following:

- An installation of [Arm Keil MDK](https://learn.arm.com/install-guides/mdk/) or [Arm Development Studio](https://learn.arm.com/install-guides/armds/) (MDK recommended)
- Some familiarity with CMSIS is assumed

## Summary

You’ll create a minimal RTX5 application with the CMSIS-RTOS2 API in Keil μVision. First, you’ll install the latest CMSIS packs, configure a new project, and implement a `main()` that initializes the system tick and starts the kernel. Then, you’ll create an `app_main` control thread that creates additional worker threads to demonstrate basic multitasking. After building, you’ll run on a Fixed Virtual Platform from Keil MDK, inspect scheduler state and thread activity using the **RTX RTOS** view, and check formatted output in the **Serial Windows > Debug (printf)** window. Finally, you’ll configure **CMSIS-View Event Recorder** to capture runtime events and redirect `STDOUT` when semihosting isn’t available.

## Frequently asked questions

### How do I check that the required CMSIS packs are installed before creating the project?
Open the **Pack Installer** from Keil MDK and install the latest CMSIS packs. Update to the most recent versions before proceeding.

### What should main() do to start RTX5, and how do I confirm the kernel is running?
`main()` sets up the SysTick using `SystemCoreClockUpdate()`, initializes the RTOS, and starts the kernel. In debug, open **View > Watch Windows > RTX RTOS** to see the kernel state and active threads.

### How many threads does the example create and where are they started?
The example starts three threads from `app_main` using `osThreadNew()`. The number and names are arbitrary and serve to illustrate basic thread creation.

### What steps build and run the project in Keil MDK, and what should I monitor during execution?
Save all files, click Build (`F7`), then Debug (`Ctrl+F5`) to launch the FVP. Open the RTX RTOS view and the **Serial Windows > Debug (printf)** window, click Run (`F5`), and observe thread activity and output before stopping.

### When should I use Event Recorder and how do I route STDOUT to it?
Use Event Recorder when semihosting isn’t supported in Keil MDK. Enable **CMSIS-View > Event Recorder (DAP variant)**, set **CMSIS-Compiler > STDOUT (API)** to **Event Recorder**, and enable **CMSIS-Compiler > Core**. In Arm Development Studio, Event Recorder and Component Viewer aren’t supported.
