This repository contains an exemplary CMSIS solution file that can be used to build two Zephyr basic examples on ST development boards. It can be easily adapted to other boards or examples. It uses Zephyr's west build system to create the executable file for an application and the Arm CMSIS Debugger to flash download and run the image on the target hardware.
- Clone this repository onto your machine.
- Install Zephyr.
- Open this repository in VS Code. It should install required extensions automatically.
- In the CMSIS view, click on ..., use Open Solution in Workspace, and choose your desired project.
- Set the environment variables for Zephyr workspace and Python virtual environoment as explained in the Keil Studio documentation.
- Make sure to fully restart the VS Code.
- Press the Manage Solution Settings button. In the dialog, select the target board and application.
- Press the Build solution button to build the example.
- Press the Load & Debug application button to start a debug session.
Note
Check that the Arm CMSIS Solution extension is at least v1.64.0.
This chapter contains installation instructions for Linux and macOS and Windows.
-
In your home directory, create a
zephyrprojectdirectory and change into it:mkdir zephyrproject cd zephyrproject -
Create a new virtual environment:
python3 -m venv .venv
-
Activate the virtual environment:
source .venv/bin/activateOnce activated, your shell will be prefixed with (.venv). The virtual environment can be deactivated at any time by running
deactivate. -
Install west:
pip install west
-
Get the standard Zephyr source code:
west init west update
-
Install Python dependencies using west packages:
west packages pip --install
-
Open a
cmd.exeterminal window as a regular user. -
Create a
zephyrprojectdirectory and change into it:mkdir zephyrproject cd zephyrproject -
Create a new virtual environment:
python -m venv .venv
-
Activate the virtual environment:
.venv\Scripts\activate.bat
Once activated your shell will be prefixed with (.venv). The virtual environment can be deactivated at any time by running
deactivate. -
Install west:
pip install west
-
Get the standard Zephyr source code:
west init west update
-
Install Python dependencies using west packages.
west packages pip --install
| Example name | Description |
|---|---|
| blinky | A standard Zephyr basic example that blinks an LED forever using the Zephyr GPIO API by configuring a pin as output and toggling it in a loop. |
| threads | A standard Zephyr basic example that spawns multiple compile-time threads that blink LEDs with different periods and report status via a FIFO to a print thread. |
For more information about each example, please see the official Zephyr example repository.