You’ll create a basic RTX-based RTOS application using CMSIS and Keil Studio for VS Code .
The steps use the Cortex-M4 Fixed Virtual Platform (FVP), but you can follow along with any of the 10,000+ devices supported by CMSIS-Pack .
If using Arm Keil μVision IDE or Arm Development Studio, refer to the
Build an RTX5 RTOS application with Keil μVision
guide.
Keil Studio projects are based on the CMSIS Solution standard.
ARMCM4.VS Code allows complete configurability of all aspects of the project.
vcpkg-configuration.json within the project. This file defines the components used.From the dropdown menus, make sure to select the most up-to-date versions of the following:
Set all other tools to None as they are not needed for this example.
If you open vcpkg-configuration.json in the text editor, you’ll see these selections reflected. Close the file to save your changes.
All necessary components will be downloaded and installed as necessary (if not already installed).
Enable the following components:
CMSIS > CoreCMSIS > OSTick > SysTickCMSIS > RTOS2 > Keil RTXDevice > StartupYou may need to select Software packs: All packs from the drop-down.
If prompted in the Validation pane, select the latest available version for each. Use the CMSIS-RTX pack if others are shown.
Close this view to save.
Use scatter-loading to define the memory map to the linker.
The memory map for the FVP is given in the documentation .
The project should be configured to use ARMCM4_ac6.sct as the scatter file. Locate this file in the CMSIS Extension view and select it to create.
Populate with the following.
LOAD 0x0 0x400000 {
ROOT 0x0 0x400000 {
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO) }
RAM 0x20000000 0x40000 {
.ANY (+RW +ZI) }
ARM_LIB_HEAP 0x20040000 EMPTY 0x10000 {}
ARM_LIB_STACK 0x20050000 EMPTY 0x10000 {}
}
launch.json. This file defines the debug instance.launch.json and select Open Run and Debug Configuration.From the Selected Configuration drop-down, select New Configuration > Launch FVP. Edit the Configuration Name if desired.
From the Target > Configuration Database Entry drop-down, select MPS2_Cortex_M4 > Cortex-M4.
Leave other fields as default. Observe that launch.json has been updated.
Close the file to save your configuration.