This repository contains two basic Zephyr examples configured in the zephyr.csolution.yml file for multiple development boards. It uses Keil Studio and the Zephyr west build system to generate the application image.
The Arm CMSIS Debugger provides kernel-aware debugging and views for device peripherals, including the interrupt system. It is used to download and run the application on target hardware.
pyOCD supports with RTT and SystemView the analysis of the run-time behavior in CI workflows.
Overall, Zephyr development is simplified by managing different build configurations, using an intuitive project tree, supporting multi-core configurations, and providing smart editor features such as code completion.
- Install Keil Studio for VS Code from the VS Code marketplace.
- Follow the Zephyr Getting Started Guide and install Zephyr in the directory
$HOME/zephyrproject. - Clone this repository (for example using Git in VS Code) or download the ZIP file. Then open the repository folder in VS Code.
- In VS Code, open the CMSIS View and then the Manage Solution dialog to select the target board and one project.
- In the CMSIS view, use the Action buttons to build, load, and debug the example on your hardware.
Caution
If you see errors during west build (for example during generating a build system), the west installation or PATH is likely incorrect. Check Settings - Cmsis-Csolution: Environment Variables.
- For Windows, set
PATHto$HOME/zephyrproject/.venv/scripts - For Mac/Linux, set
PATHto$HOME/zephyrproject/.venv/bin
Tip
For more information, see the Keil Studio documentation - Work with Zephyr applications.
If you use a different board, extend the zephyr.csolution.yml file with:
# List the packs that define the device and/or board.
packs:
- pack: Vendor::DFP
- pack: Vendor::BSP
# List different hardware targets that are used to deploy the solution.
target-types:
- type: SpecifyName
board: Vendor::Board_name # Vendor is optional
device: Vendor::Device_name # Vendor and Devicename is optional To find the packs open https://www.keil.arm.com/boards/ and search for your board.
pack: Vendor::BSPis listed under CMSIS Pack on the Board page.pack: Vendor::DFPis listed under CMSIS Pack on the related Device page.
Frequently the Zephyr board name does not match. In this case add the variable west-board: as shown below.
Use Zephyr - Supported Boards and Shields and find your board. Under Supported Features the board_name, board_name/soc_name or board_name/soc_name/core_name is listed that is the specified with west-board: .
target-types:
- type: B-L475-IOT01A
board: STMicroelectronics::B-L475E-IOT01A
device: STMicroelectronics::STM32L475VGTx
variables:
- west-board: disco_l475_iot1/stm32l475xxKeil Studio includes a built-in Zephyr Terminal for running west commands in the IDE. When you open it, it configures for the selected project with the working directory and Zephyr environment.
Example west commands:
# Build the project
west build
# Open GUI configuration
west build -t guiconfig
# Generate RAM report
west build -t ram_reportSEGGER Real-Time Transfer (RTT) enables real-time data exchange between a target device and a host debugger without requiring an additional UART interface. RTT also is the transport mechanism used for SystemView.
RTT and SystemView is integrated in Zephyr and enabled in the zephyr.csolution.yml file with the west-defs under the build-type: Debug-RTT. RTT and SystemView are currently implemented for CI testing and can be used with pyOCD as shown below.
**Example invocation for target-type: STM32H7B3I-DK:
pyocd load --cbuild-run <path>\out\zephyr+STM32H7B3I-DK.cbuild-run.yml
pyocd run --cbuild-run <path>\out\zephyr+STM32H7B3I-DK.cbuild-run.ymlThe pyOCD run command outputs now test messages to the debug console and collects the file out\zephyr+STM32H7B3I-DK.SVdat that can be analyzed with SEGGER SystemView.

