You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Using Zephyr with Keil Studio and Arm CMSIS Debugger
2
2
3
-
This repository contains an exemplary CMSIS solution file that can be used to build two Zephyr basic examples on multiple
4
-
different development boards. It can be easily adapted to other boards or examples. It uses Zephyr's `west` build
5
-
system to create the executable file for an application and the
6
-
[Arm CMSIS Debugger](https://marketplace.visualstudio.com/items?itemName=Arm.vscode-cmsis-debugger) to flash download
7
-
and run the image on the target hardware.
3
+
[<imgsrc="./images/preview.png"alt="Overview of Zephyr capabilities in Keil Studio"width="330"height="205"align="left">](https://armkeil.blob.core.windows.net/developer/Files/videos/KeilStudio/CMSIS-Zephyr.mp4"Overview of Zephyr capabilities in Keil Studio")
8
4
9
-
> [!NOTE]
10
-
> Make sure that you have installed Zephyr as explained in the
11
-
> [Keil Studio documentation](https://mdk-packs.github.io/vscode-cmsis-solution-docs/zephyr.html).
5
+
This repository contains two basic Zephyr examples configured in the [`zephyr.csolution.yml`](./zephyr.csolution.yml) file for multiple development boards. It uses [Keil Studio](https://marketplace.visualstudio.com/items?itemName=Arm.keil-studio-pack) and the Zephyr `west` build system to generate the application image.
12
6
13
-
## Quick start
7
+
The [Arm CMSIS Debugger](https://marketplace.visualstudio.com/items?itemName=Arm.vscode-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.
8
+
9
+
pyOCD supports with RTT and SystemView the analysis of the run-time behavior in CI workflows.
14
10
15
-
- Clone this repository onto your machine.
16
-
- Open it in VS Code. It should install required extensions automatically.
17
-
- Press the **Manage Solution Settings** button. In the dialog, select the target board and application.
18
-
- Press the **Build solution** button to build the example.
19
-
- Press the **Load & Debug application** button to start a debug session.
11
+
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.
12
+
13
+
## Quick start
20
14
21
-
> [!NOTE]
22
-
> - Check that the **Arm CMSIS Solution** extension is at least v1.66.0.
23
-
> - If you are working under Windows, you will get the error `exec: "west": executable file not found in %PATH%` because in this example the path to the west build system is set up for Linux/Mac. Open the settings of the **Arm CMSIS Solution** extension and change the `PATH` environment variable of the **Workspace** from `$HOME/zephyrproject/.venv/bin` to `$HOME/zephyrproject/.venv/Scripts`.
15
+
1. Install [Keil Studio for VS Code](https://marketplace.visualstudio.com/items?itemName=Arm.keil-studio-pack) from the VS Code marketplace.
16
+
2. Follow the [Zephyr Getting Started Guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) and install Zephyr in the directory `$HOME/zephyrproject`.
17
+
3. Clone this repository (for example using [Git in VS Code](https://code.visualstudio.com/docs/sourcecontrol/intro-to-git)) or download the ZIP file. Then open the repository folder in VS Code.
18
+
4. In VS Code, open the [CMSIS View](https://mdk-packs.github.io/vscode-cmsis-solution-docs/userinterface.html#2-main-area-of-the-cmsis-view) and then the [Manage Solution dialog](https://github.com/Open-CMSIS-Pack/vscode-cmsis-solution#manage-solution-view) to select the target board and one project.
19
+
5. In the CMSIS view, use the [Action buttons](https://github.com/ARM-software/vscode-cmsis-csolution?tab=readme-ov-file#action-buttons) to build, load, and debug the example on your hardware.
24
20
21
+
> [!CAUTION]
22
+
> If you see errors during `west build` (for example during `generating a build system`), the `west` installation or `PATH` is likely incorrect. Check [Settings](https://code.visualstudio.com/docs/configure/settings) - **Cmsis-Csolution:** Environment Variables.
23
+
>
24
+
> - For Windows, set `PATH` to `$HOME/zephyrproject/.venv/scripts`
25
+
> - For Mac/Linux, set `PATH` to `$HOME/zephyrproject/.venv/bin`
26
+
<!-- -->
27
+
> [!TIP]
28
+
> For more information, see the [Keil Studio documentation - Work with Zephyr applications](https://mdk-packs.github.io/vscode-cmsis-solution-docs/zephyr.html).
25
29
26
-
### Switch to a different board
30
+
##Add another board
27
31
28
-
If you want to run the examples on a different board, simply extend the `zephyr.csolution.yml` file:
29
-
- Search for your [development board](https://www.keil.arm.com/boards/) and select it.
30
-
- Follow the link to the **Device** and its **CMSIS Pack** (DFP) and copy the text in the **Add to CMSIS Solution** box into the 'zephyr.csolution.yml' file into the 'packs:' list.
31
-
- Go back to the board page and follow the link to the **CMSIS Pack** (BSP). Again, copy the text in the **Add to CMSIS Solution** box into the 'zephyr.csolution.yml' below the DFP.
32
-
- Add a new [Target Type](https://open-cmsis-pack.github.io/cmsis-toolbox/YML-Input-Format/#target-types) and specify the board name after the '- type' token.
33
-
- Specify the board vendor and boardname as well as the device vendor and the device name. Use the names from the CMSIS board and device pages.
32
+
If you use a different board, extend the [`zephyr.csolution.yml`](zephyr.csolution.yml) file with:
34
33
35
34
```yml
36
35
# List the packs that define the device and/or board.
@@ -41,12 +40,20 @@ If you want to run the examples on a different board, simply extend the `zephyr.
41
40
# List different hardware targets that are used to deploy the solution.
42
41
target-types:
43
42
- type: SpecifyName
44
-
board: Vendor::Boardname
45
-
device: Vendor::Devicename
43
+
board: Vendor::Board_name # Vendor is optional
44
+
device: Vendor::Device_name # Vendor and Devicename is optional
46
45
```
47
46
48
-
If your development board's [CMSIS board name](https://www.keil.arm.com/boards/) and
49
-
[Zephyr board name](https://docs.zephyrproject.org/latest/boards/index.html#) do not match, you need to add the correct Zephyr board name with the variable `west-board:`. This variable may contain the `Board_Name`, or the `Board_Name/SoC_Name` or the `Board_Name/SoC_Name/Core_Name`, depending on the complexity of the board and SoC. See the paragraph **Supported Features** on the Zephyr board pages for more details.
47
+
To find the packs open [https://www.keil.arm.com/boards/](https://www.keil.arm.com/boards/) and search for your board.
48
+
49
+
- `pack: Vendor::BSP` is listed under CMSIS Pack on the [Board](https://www.keil.arm.com/boards/) page.
50
+
- `pack: Vendor::DFP` is listed under CMSIS Pack on the related [Device](https://www.keil.arm.com/devices/) page.
51
+
52
+
### Board name different in Zephyr and CMSIS Pack
53
+
54
+
Frequently the [Zephyr board name](https://docs.zephyrproject.org/latest/boards/index.html#) does not match. In this case add the variable `west-board:` as shown below.
55
+
56
+
Use [Zephyr - Supported Boards and Shields](https://docs.zephyrproject.org/latest/boards/index) 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:` .
50
57
51
58
```yml
52
59
target-types:
@@ -57,17 +64,13 @@ If your development board's [CMSIS board name](https://www.keil.arm.com/boards/)
57
64
- west-board: disco_l475_iot1/stm32l475xx
58
65
```
59
66
60
-
> [!NOTE]
61
-
> Make sure to delete the previous `/out` and `/tmp` directories before saving the updated `*.csolution.yml` file,
62
-
> otherwise the solution might not load correctly.
67
+
## Zephyr Terminal
63
68
64
-
## Use the Zephyr Terminal in CMSIS View
69
+

65
70
66
-

71
+
Keil 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.
67
72
68
-
Keil Studio includes a built-in **Zephyr Terminal** that runs `west` commands directly inside the IDE. When the terminal opens, it automatically sets the example build folder as the working directory and configures the Zephyr environment.
69
-
70
-
Example `west` commands:
73
+
**Example `west` commands:**
71
74
72
75
```bash
73
76
# Build the project
@@ -80,6 +83,17 @@ west build -t guiconfig
80
83
west build -t ram_report
81
84
```
82
85
83
-
## Introduction video
86
+
## RTT and SEGGER SystemView
87
+
88
+
SEGGER 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.
89
+
90
+
RTT and SystemView is integrated in Zephyr and enabled in the [`zephyr.csolution.yml`](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.
91
+
92
+
**Example invocation for `target-type: STM32H7B3I-DK`:
pyocd run --cbuild-run <path>\out\zephyr+STM32H7B3I-DK.cbuild-run.yml
97
+
```
84
98
85
-
[](https://armkeil.blob.core.windows.net/developer/Files/videos/KeilStudio/CMSIS-Zephyr.mp4)
99
+
The 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](https://www.segger.com/products/development-tools/systemview/).
0 commit comments