Skip to content

Commit 4e3de50

Browse files
Further improvements of this example project (#14)
* - added STM32H7B3I-DK board - removed NXP FRDM-MCXN947 board - added RTT debug configuration for STM32H7B3I-DK board - corrected the README.md file which described two different csolution files * Further improvements in the README.md file, and added a screenshot of the Zephyr Terminal in the video folder. Also updated the zephyr.csolution.yml file for a more precise Zephyr board selection * Update VSCode settings and add STM32H7B3I-DK debug configuration files
1 parent 5f428e5 commit 4e3de50

6 files changed

Lines changed: 64 additions & 28 deletions

File tree

.vscode/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,13 @@
55
"VIRTUAL_ENV": "$HOME/zephyrproject/.venv",
66
},
77
"debug.hideSlowPreLaunchWarning": true,
8-
"debug.showInStatusBar": "never"
8+
"debug.showInStatusBar": "never",
9+
"memory-inspector.addressPadding": "32bit",
10+
"memory-inspector.groupings.groupsPerRow": "Autofit",
11+
"memory-inspector.groupings.MAUsPerGroup": 4,
12+
"memory-inspector.scrollingBehavior": "Auto-Append",
13+
"clangd.arguments": [
14+
"--compile-commands-dir=c:\\Kunden\\RTT_Examples\\CMSIS-Zephyr\\out\\blinky\\STM32H7B3I-DK\\Debug"
15+
],
16+
"cmsis-csolution.autoDebugLaunch": true
917
}

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CMSIS-Zephyr
22

3-
This repository contains an exemplary CMSIS solution file that can be used to build two Zephyr basic examples on two
3+
This repository contains an exemplary CMSIS solution file that can be used to build two Zephyr basic examples on multiple
44
different development boards. It can be easily adapted to other boards or examples. It uses Zephyr's `west` build
55
system to create the executable file for an application and the
66
[Arm CMSIS Debugger](https://marketplace.visualstudio.com/items?itemName=Arm.vscode-cmsis-debugger) to flash download
@@ -14,18 +14,23 @@ and run the image on the target hardware.
1414

1515
- Clone this repository onto your machine.
1616
- Open it in VS Code. It should install required extensions automatically.
17-
- In the CMSIS view, click on **...**, use **Open Solution in Workspace**, and choose "zephyr".
1817
- Press the **Manage Solution Settings** button. In the dialog, select the target board and application.
1918
- Press the **Build solution** button to build the example.
2019
- Press the **Load & Debug application** button to start a debug session.
2120

2221
> [!NOTE]
23-
> Check that the **Arm CMSIS Solution** extension is at least v1.66.0.
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`.
24+
2425

2526
### Switch to a different board
2627

27-
If you want to run the examples on a different board, simply edit the `Examples/Blinky/blinky.csolution.yml` or
28-
`Examples/Threads/threads.csolution.yml` files:
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.
2934

3035
```yml
3136
# List the packs that define the device and/or board.
@@ -41,16 +46,15 @@ If you want to run the examples on a different board, simply edit the `Examples/
4146
```
4247
4348
If your development board's [CMSIS board name](https://www.keil.arm.com/boards/) and
44-
[Zephyr board name](https://docs.zephyrproject.org/latest/boards/index.html#) do not match, you need to add the correct
45-
Zephyr board name like this:
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.
4650

4751
```yml
4852
target-types:
4953
- type: B-L475-IOT01A
5054
board: STMicroelectronics::B-L475E-IOT01A
5155
device: STMicroelectronics::STM32L475VGTx
5256
variables:
53-
- west-board: disco_l475_iot1
57+
- west-board: disco_l475_iot1/stm32l475xx
5458
```
5559

5660
> [!NOTE]
@@ -59,6 +63,8 @@ Zephyr board name like this:
5963

6064
## Use the Zephyr Terminal in CMSIS View
6165

66+
![ZephyrTerminal](video/ZephyrTerminal.png)
67+
6268
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.
6369

6470
Example `west` commands:

vcpkg-configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"arm:tools/kitware/cmake": "^3.31.5",
1212
"arm:tools/ninja-build/ninja": "^1.12.1",
1313
"arm:compilers/arm/arm-none-eabi-gcc": "^14.3.1",
14-
"arm:tools/open-cmsis-pack/cmsis-toolbox": "2.12.0"
14+
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.13.0"
1515
}
1616
}

video/ZephyrTerminal.png

37.6 KB
Loading

zephyr.cbuild-pack.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
cbuild-pack:
22
resolved-packs:
3+
- resolved-pack: Infineon::CAT1C_DFP@1.2.0
4+
selected-by-pack:
5+
- Infineon::CAT1C_DFP
6+
- resolved-pack: Infineon::KIT_T2G-B-H_LITE_BSP@1.2.1
7+
selected-by-pack:
8+
- Infineon::KIT_T2G-B-H_LITE_BSP
39
- resolved-pack: Keil::B-L475E-IOT01A_BSP@2.1.0
410
selected-by-pack:
511
- Keil::B-L475E-IOT01A_BSP
6-
- resolved-pack: Keil::B-U585I-IOT02A_BSP@2.0.0
12+
- resolved-pack: Keil::B-U585I-IOT02A_BSP@3.0.0
713
selected-by-pack:
814
- Keil::B-U585I-IOT02A_BSP
15+
- resolved-pack: Keil::STM32H7B3I-DK_BSP@2.1.1
16+
selected-by-pack:
17+
- Keil::STM32H7B3I-DK_BSP
18+
- resolved-pack: Keil::STM32H7xx_DFP@4.1.3
19+
selected-by-pack:
20+
- Keil::STM32H7xx_DFP
921
- resolved-pack: Keil::STM32L4xx_DFP@3.1.0
1022
selected-by-pack:
1123
- Keil::STM32L4xx_DFP
12-
- resolved-pack: Keil::STM32U5xx_DFP@3.0.0
24+
- resolved-pack: Keil::STM32U5xx_DFP@3.2.0
1325
selected-by-pack:
1426
- Keil::STM32U5xx_DFP
15-
- resolved-pack: NXP::FRDM-MCXN947_BSP@19.0.0
16-
selected-by-pack:
17-
- NXP::FRDM-MCXN947_BSP@19.0.0
18-
- resolved-pack: NXP::MCXN947_DFP@19.0.0
19-
selected-by-pack:
20-
- NXP::MCXN947_DFP@19.0.0

zephyr.csolution.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ solution:
77
- pack: Keil::B-L475E-IOT01A_BSP
88
- pack: Keil::STM32U5xx_DFP
99
- pack: Keil::B-U585I-IOT02A_BSP
10-
- pack: NXP::MCXN947_DFP@19.0.0
11-
- pack: NXP::FRDM-MCXN947_BSP@19.0.0
10+
- pack: Keil::STM32H7xx_DFP
11+
- pack: Keil::STM32H7B3I-DK_BSP
1212
- pack: Infineon::CAT1C_DFP
1313
- pack: Infineon::KIT_T2G-B-H_LITE_BSP
1414

@@ -18,14 +18,13 @@ solution:
1818
board: STMicroelectronics::B-L475E-IOT01A
1919
device: STMicroelectronics::STM32L475VGTx
2020
variables:
21-
- west-board: disco_l475_iot1
21+
- west-board: disco_l475_iot1/stm32l475xx
2222
target-set:
2323
- set:
2424
images:
2525
- project-context: blinky.Debug
2626
debugger:
2727
name: ST-Link@pyOCD
28-
port: 3333
2928
protocol: swd
3029
clock: 4000000
3130
- type: B-U585I-IOT02A
@@ -35,17 +34,27 @@ solution:
3534
- set:
3635
images:
3736
- project-context: threads.Debug
38-
39-
- type: FRDM-MCXN947
40-
board: NXP::FRDM-MCXN947
41-
device: NXP::MCXN947VDF:cm33_core0
37+
- type: STM32H7B3I-DK
38+
board: STMicroelectronics::STM32H7B3I-DK
39+
device: STMicroelectronics::STM32H7B3LIHxQ
4240
variables:
43-
- west-board: frdm_mcxn947/mcxn947/cpu0
41+
- west-board: stm32h7b3i_dk/stm32h7b3xx
4442
target-set:
4543
- set:
44+
debugger:
45+
name: ST-Link@pyOCD
46+
clock: 10000000
47+
protocol: swd
48+
rtt:
49+
- channel:
50+
- number: 0
51+
mode: stdio
52+
- number: 1
53+
mode: systemview
54+
telnet:
55+
- mode: console
4656
images:
4757
- project-context: blinky.Debug
48-
4958
- type: IFX_T2G_B_H
5059
board: KIT_T2G-B-H_LITE
5160
device: CYT4BF8CDS:Cortex-M0p
@@ -64,6 +73,13 @@ solution:
6473
- CONFIG_DEBUG_THREAD_INFO: y
6574
- CONFIG_THREAD_STACK_INFO: n
6675
- CONFIG_DEBUG_OPTIMIZATIONS: y
76+
# uncomment the following lines to enable RTT console and SystemView tracing
77+
# - CONFIG_USE_SEGGER_RTT: y
78+
# - CONFIG_RTT_CONSOLE: y
79+
# - CONFIG_UART_CONSOLE: n
80+
# - CONFIG_TRACING: y
81+
# - CONFIG_SEGGER_SYSTEMVIEW: y
82+
# - CONFIG_SEGGER_SYSVIEW_RTT_CHANNEL: 1
6783
- type: Release
6884
west-defs:
6985
- CONFIG_SIZE_OPTIMIZATIONS: y

0 commit comments

Comments
 (0)