# Build an RTX5 RTOS application with Keil Studio (VS Code)

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx_vs/)
- [Create csolution project](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx_vs/create/)
- [Initialize the Operating System](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx_vs/initialize/)
- [Create RTOS Threads](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx_vs/threads/)
- [Build and run the application](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx_vs/build_and_run/)
- [Next Steps](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsis_rtx_vs/_next-steps/)

## About this Learning Path

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

|  |  |
| --- | --- |
| Author: | Ronan Synnott , Arm<br>[LinkedIn](https://linkedin.com/in/ronansynnott) |
| Arm IP: | [Cortex-M](https://support.arm.com/?tab=compute-ip&Product%20Type=Microcontrollers) |
| Tags: | [RTOS Fundamentals](https://learn.arm.com/tag/rtos-fundamentals) [RTOS](https://learn.arm.com/tag/rtos) [Keil RTX RTOS](https://learn.arm.com/tag/keil-rtx-rtos) [Keil MDK](https://learn.arm.com/tag/keil-mdk) [Arm Development Studio](https://learn.arm.com/tag/arm-development-studio) |

### Who is this for?
This is an introductory topic for software developers new to RTOS development.

### What will you learn?
After completing this Learning Path, you'll be able to perform the following tasks:
- 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'll need the following prerequisites:
- Installation of [Arm Keil Studio for VS Code](https://learn.arm.com/install-guides/keilstudio_vs/)
- Some familiarity with CMSIS is assumed

### Summary
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

**Which target should I use if I don’t have hardware available?**

Use the Cortex-M4 Fixed Virtual Platform (FVP) referenced in the steps. The procedure also applies to other devices supported by CMSIS-Pack.

**How do I start a debug session in Keil Studio for VS Code?**

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.

**How do I know the RTOS is running correctly?**

After initialization, the **Debug Console** displays messages from your threads. Look for output similar to: `[model] hello from thread 1/2/3`.

**Where do main.c and app_main.c come from?**

`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.

**Can I change the number or names of the threads?**

Yes. The number and naming of threads created by `app_main` are flexible, so adjust them to match your application structure.
