Build an RTX5 RTOS application with Keil Studio (VS Code)
Introduction
Create csolution project
Initialize the Operating System
Create RTOS Threads
Build and run the application
Next Steps
Build an RTX5 RTOS application with Keil Studio (VS Code)
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:
- Understand the basics of RTX-based RTOS application development
- Configure and manage an RTOS project in Keil Studio, including defining the memory map, selecting software components, and setting up debugging configurations for Cortex-M processors
- Create and manage multiple threads within an RTX5 RTOS application
Prerequisites
Before starting, you will need the following:
- Installation of Arm Keil Studio for VS Code
- 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, configure, and debug an RTX5-based application in Keil Studio for VS Code using the CMSIS-RTOS2 API. First, you’ll create a CMSIS Solution project, select required components in the Run-Time Environment, and add system startup so RTX5 can initialize the SysTick timer with
SystemCoreClockUpdate() before starting the scheduler. Then, you’ll implement an app_main thread that launches multiple worker threads and builds the project using the CMSIS extension. Using the Cortex-M4 Fixed Virtual Platform as the target, you’ll run and step through the program and verify execution by observing periodic thread messages printed in the Debug Console.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.
Use the Cortex-M4 Fixed Virtual Platform (FVP) referenced in the steps. The procedure also applies to other devices supported by CMSIS-Pack.
Select the Debug icon or open the Run and Debug view, then choose the configured debug connection to launch the FVP. Use the standard debugging controls to step through your code.
After initialization, the Debug Console displays messages from your threads. Look for output similar to:
[model] hello from thread 1/2/3.main.c is created automatically in the Source Files group when you set up the CMSIS Solution project. Add app_main.c by clicking the + icon in the Source Files group.Yes. The number and naming of threads created by
app_main are flexible, so adjust them to match your application structure.