The Blinky project can be easily used to verify the basic tool setup:
- In the beginning,
vioLED0blinks in 1 sec interval. - Pressing
vioBUTTON0changes the blink frequency and start/stopsvioLED1. printfmessages are shown on the serial console.
The output of the serial console can be observed via the SERIAL MONITOR in Visual Studio Code.
Refer to Project Configuration for board specific settings.
The following tools need to be installed on your machine:
- CMSIS-Toolbox v2.12.0 or newer
- Microsoft Visual Studio Code with Keil Studio Pack extension (optional, alternatively CLI can be used)
- Arm Compiler 6 (automatically installed when using Visual Studio Code with vcpkg)
The following is written for Keil Studio, a set of VS Code extensions.
Required tools described in file vcpkg-configuration.json should be automatically installed by vcpkg. You can see the
status of vcpkg in the status bar.
Required CMSIS packs need to be also installed. In case a required pack is missing, a notification window will pop-up to install the missing pack.
Open the CMSIS view from the side bar and press the Build button.
Download required packs (not required when the packs are already available) by executing the following commands:
csolution list packs -s Blinky.csolution.yml -m > packs.txt
cpackget update-index
cpackget add -f packs.txtBuild the project by executing the following command:
cbuild Blinky.csolution.yml- Connect the board's MCU-LINK USB to the PC (provides also power).
- Open the 'CMSIS' view from the side bar and press the 'Run' button and wait until the image is programmed and starts running.
Open the CMSIS view from the side bar and press the Debug button. In the Debug view, use the SERIAL MONITOR to connect to the board's serial port with 115200 baud rate and observe the output.
RTOS awareness is available through the XRTOS view in the bottom panel.
The real-time operating system Keil RTX5 implements the resource management.
It is configured with the following settings:
- Global Dynamic Memory size: 4096 bytes
- Default Thread Stack size: 512 bytes
Refer to Configure RTX v5 for a detailed description of all configuration options.
This example uses virtual I/Os to map physical board hardware using the CMSIS-Driver VIO API.
| CMSIS-Driver VIO | Physical board hardware |
|---|---|
| vioBUTTON0 | Wake up button (SW2) |
| vioLED0 | User LED Red (RGB) |
| vioLED1 | User LED Green (RGB) |
STDIO is routed to a debug console through a virtual COM port (MCU-Link, baudrate = 115200).