Build an RTX5 RTOS application with Keil μVision
Introduction
Create and setup Keil MDK project
Initialize the operating system
Create RTOS threads
Build and run the application
Using Event Recorder
Next Steps
Build an RTX5 RTOS application with Keil μVision
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 or Arm Development Studio (MDK recommended)
- Some familiarity with CMSIS is assumed
Summary
This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
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
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Open the Pack Installer from Keil MDK and install the latest CMSIS packs. Update to the most recent versions before proceeding.
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.The example starts three threads from
app_main using osThreadNew(). The number and names are arbitrary and serve to illustrate basic thread creation.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.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.