Skip to content

Commit f0ba130

Browse files
authored
Added a Zephyr based build workflow a.o.
Added a Zephyr based build workflow, on a GitHub hosted runner, for an application which will be executed on a NUCLEO-H563ZI board. Added an execution workflow, on a Raspberry PI self hosted runner, for this application.
1 parent 7db25da commit f0ba130

4 files changed

Lines changed: 215 additions & 5 deletions

File tree

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# SPDX-FileCopyrightText: Copyright 2022-2026 Arm Limited and/or its
2+
# affiliates <open-source-office@arm.com>
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
name: Build NUCLEO-H563ZI Debug HIL
18+
on:
19+
workflow_dispatch:
20+
21+
jobs:
22+
CI:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v6
28+
29+
- name: Activate vcpkg
30+
uses: ARM-software/cmsis-actions/vcpkg@v1
31+
with:
32+
config: "./vcpkg-configuration.json"
33+
cache: "NUCLEO-H563ZI"
34+
35+
- name: Activate Arm tool license
36+
uses: ARM-software/cmsis-actions/armlm@v1
37+
38+
- name: Initialize CMSIS pack root folder
39+
run: |
40+
cpackget init https://www.keil.com/pack/index.pidx
41+
cpackget update-index
42+
43+
- name: Install dependencies
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y --no-install-recommends git cmake ninja-build gperf \
47+
ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \
48+
xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
49+
50+
- name: Create a Python virtual environment
51+
run: |
52+
echo "Create a new virtual environment in /home/runner/zephyrproject/ "
53+
python -m venv /home/runner/zephyrproject/.venv
54+
echo "/home/runner/zephyrproject/.venv/bin" >> $GITHUB_PATH
55+
56+
- name: Install west
57+
continue-on-error: true
58+
run: |
59+
# 1. Upgrade pip
60+
python -m pip install --upgrade pip
61+
62+
# 2. Change to the zephyrproject directory
63+
cd /home/runner/zephyrproject
64+
65+
# 3. Install west
66+
pip install west
67+
68+
# 4. Show where west gets installed
69+
which west
70+
71+
# 5. Initialize Zephyr workspace
72+
west init
73+
74+
# 6. Update Zephyr workspace
75+
west -v update
76+
77+
- name: Cache the Zephyrproject
78+
uses: actions/cache@v5
79+
with:
80+
key: install-west
81+
path: /home/runner/zephyrproject
82+
83+
- name: Install Zephyr Python dependencies
84+
run: |
85+
# 1. Change to the zephyrproject directory
86+
cd /home/runner/zephyrproject
87+
88+
# 2. Activate the virtual environment
89+
source ./.venv/bin/activate
90+
91+
# 3. Install west packages
92+
west packages pip --install
93+
94+
- name: Set Zephyr environment
95+
run: |
96+
echo "ZEPHYR_BASE=/home/runner/zephyrproject/zephyr" >> $GITHUB_ENV
97+
echo "VIRTUAL_ENV=/home/runner/zephyrproject/.venv" >> $GITHUB_ENV
98+
echo "PATH=/home/runner/zephyrproject/.venv/bin:$PATH" >> $GITHUB_ENV
99+
100+
- name: Build the NUCLEO-H563ZI HIL binary
101+
run: |
102+
# 1. Activate the virtual environment
103+
source /home/runner/zephyrproject/.venv/bin/activate
104+
105+
# 2. Build binary
106+
cbuild zephyr.csolution.yml --active NUCLEO-H563ZI@HIL --packs
107+
108+
- name: Upload output NUCLEO-H563ZI_Debug_HIL
109+
uses: actions/upload-artifact@v7
110+
with:
111+
name: NUCLEO-H563ZI@Debug_HIL
112+
path: |
113+
./out/
114+
include-hidden-files: true
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-FileCopyrightText: Copyright 2022-2026 Arm Limited and/or its
2+
# affiliates <open-source-office@arm.com>
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
name: Run NUCLEO-H563ZI Debug HIL
18+
19+
on:
20+
workflow_dispatch:
21+
22+
jobs:
23+
CI:
24+
runs-on: [self-hosted, rsp-p5-01]
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v6
29+
30+
- name: Download Build Artifact
31+
uses: dawidd6/action-download-artifact@v21
32+
with:
33+
workflow: Build_NUCLEO-H563ZI.yaml
34+
name: NUCLEO-H563ZI@Debug_HIL
35+
path: ./out
36+
37+
- name: Flash the application
38+
working-directory: ./out
39+
run: |
40+
pyocd load --uid 001700054142501320353451 --cbuild-run zephyr+NUCLEO-H563ZI.cbuild-run.yml -O smart_flash=false
41+
42+
- name: Execute the application
43+
working-directory: ./out
44+
run: |
45+
pyocd run --uid 001700054142501320353451 --cbuild-run zephyr+NUCLEO-H563ZI.cbuild-run.yml -O reset_type=hardware --timelimit 10
46+
47+
- name: Upload SystemView file
48+
uses: actions/upload-artifact@v7
49+
with:
50+
name: NUCLEO-H563ZI_SVDat@Debug_HIL
51+
path: |
52+
./out/zephyr+NUCLEO-H563ZI.SVDat

vcpkg-configuration.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
}
88
],
99
"requires": {
10-
"arm:compilers/arm/armclang": "^6.24.0",
10+
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.13.0",
1111
"arm:tools/kitware/cmake": "^3.31.5",
12-
"arm:tools/ninja-build/ninja": "^1.12.1",
13-
"arm:compilers/arm/arm-none-eabi-gcc": "^14.3.1",
14-
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.13.0"
12+
"arm:tools/ninja-build/ninja": "^1.12.1",
13+
"arm:compilers/arm/armclang": "^6.24.0",
14+
"arm:compilers/arm/arm-none-eabi-gcc": "^14.3.1"
1515
}
1616
}

zephyr.csolution.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ solution:
1111
- pack: Keil::STM32H7B3I-DK_BSP
1212
- pack: Infineon::CAT1C_DFP
1313
- pack: Infineon::KIT_T2G-B-H_LITE_BSP
14+
- pack: Keil::STM32H5xx_DFP
15+
- pack: Keil::NUCLEO-H563ZI_BSP
1416

1517
# List different hardware targets that are used to deploy the solution.
1618
target-types:
@@ -64,7 +66,49 @@ solution:
6466
- set:
6567
images:
6668
- project-context: blinky.Debug
67-
69+
- set: CI
70+
images:
71+
- project-context: blinky.Debug
72+
debugger:
73+
name: KitProg3@pyOCD
74+
port: 3333
75+
protocol: swd
76+
clock: 10000000
77+
- type: NUCLEO-H563ZI
78+
board: STMicroelectronics::NUCLEO-H563ZI
79+
device: STMicroelectronics::STM32H563ZITx
80+
variables:
81+
- west-board: nucleo_h563zi/stm32h563xx
82+
target-set:
83+
- set:
84+
images:
85+
- project-context: blinky.Debug
86+
debugger:
87+
name: ST-Link@pyOCD
88+
clock: 4000000
89+
protocol: swd
90+
- set: CI
91+
debugger:
92+
name: ST-Link@pyOCD
93+
clock: 10000000
94+
protocol: swd
95+
images:
96+
- project-context: blinky.Debug
97+
- set: HIL
98+
debugger:
99+
name: ST-Link@pyOCD
100+
clock: 10000000
101+
protocol: swd
102+
rtt:
103+
- channel:
104+
- number: 0
105+
mode: stdio
106+
- number: 1
107+
mode: systemview
108+
telnet:
109+
- mode: console
110+
images:
111+
- project-context: blinky.Debug-RTT
68112
# List of different build configurations.
69113
build-types:
70114
- type: Debug

0 commit comments

Comments
 (0)