Skip to content

Commit 1564eae

Browse files
author
Arthur Finkelmann
committed
added workflow for raytec MDBT50Q (untested)
1 parent a76d5d2 commit 1564eae

1 file changed

Lines changed: 152 additions & 0 deletions

File tree

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: Build OpenThread for Raytac MDBT50Q-CX-40
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- build-raytac
8+
- build-raytec
9+
pull_request:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
name: Build Zephyr OpenThread samples (Raytac dongle)
17+
runs-on: ubuntu-latest
18+
19+
env:
20+
BOARD: raytac_mdbt50q_cx_40_dongle/nrf52840
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.12"
30+
31+
# Sets up a Zephyr workspace, installs west, and pulls Zephyr + modules.
32+
- name: Set up Zephyr workspace
33+
uses: zephyrproject-rtos/action-zephyr-setup@v1
34+
with:
35+
# Pinning is optional; leaving this out follows the action default.
36+
sdk-version: "0.17.2"
37+
toolchains: arm-zephyr-eabi
38+
39+
# Make sure the toolchain is actually usable in later steps (fixes gcc not found).
40+
- name: Put Zephyr SDK toolchain on PATH
41+
shell: bash
42+
run: |
43+
echo "${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi/bin" >> "${GITHUB_PATH}"
44+
45+
# Fix the protobuf/nrfutil breakage (optional, but avoids your current crash).
46+
- name: Install nrfutil (protobuf pinned)
47+
shell: bash
48+
run: |
49+
python -m pip install --upgrade pip
50+
python -m pip install "protobuf==3.20.*" "nrfutil"
51+
52+
- name: Create west manifest (repo root)
53+
run: |
54+
cat > west.yml <<'YML'
55+
manifest:
56+
remotes:
57+
- name: zephyrproject-rtos
58+
url-base: https://github.com/zephyrproject-rtos
59+
projects:
60+
- name: zephyr
61+
remote: zephyrproject-rtos
62+
revision: v4.2.0
63+
import: true
64+
self:
65+
path: .
66+
YML
67+
68+
- name: West init + update
69+
run: |
70+
west init -l raytac-zephyr-workspace raytac-zephyr-ws
71+
cd raytac-zephyr-ws
72+
west update
73+
west zephyr-export
74+
75+
- name: Print tool versions
76+
shell: bash
77+
run: |
78+
west --version
79+
cmake --version
80+
ninja --version
81+
arm-zephyr-eabi-gcc --version | head -n 1
82+
nrfutil --version || true
83+
84+
# IMPORTANT: build from the Zephyr repo root, and use samples/... paths.
85+
- name: Build OpenThread shell (UART) -> ot-cli-ftd-UART
86+
working-directory: ${{ env.ZEPHYR_BASE }}
87+
shell: bash
88+
run: |
89+
west build -p always \
90+
-b "${BOARD}" \
91+
-d "${{ github.workspace }}/build/ot-cli-ftd-UART" \
92+
samples/net/openthread/shell -- \
93+
-DCONF_FILE="prj.conf"
94+
95+
# USB console: use Zephyr's snippet that redirects console to CDC-ACM.
96+
# (This is the cleanest way to get a USB serial console on many boards.)
97+
- name: Build OpenThread shell (USB CDC-ACM console) -> ot-cli-ftd-USB
98+
working-directory: ${{ env.ZEPHYR_BASE }}
99+
shell: bash
100+
run: |
101+
west build -p always \
102+
-S cdc-acm-console \
103+
-b "${BOARD}" \
104+
-d "${{ github.workspace }}/build/ot-cli-ftd-USB" \
105+
samples/net/openthread/shell -- \
106+
-DCONF_FILE="prj.conf"
107+
108+
# RCP build: Zephyr provides a coprocessor sample and an RCP overlay.
109+
# USB transport example uses usb.overlay + overlay-usb-nrf-br.conf.
110+
- name: Build OpenThread RCP (USB CDC-ACM UART transport) -> ot-rcp-USB
111+
working-directory: ${{ env.ZEPHYR_BASE }}
112+
shell: bash
113+
run: |
114+
west build -p always \
115+
-b "${BOARD}" \
116+
-d "${{ github.workspace }}/build/ot-rcp-USB" \
117+
samples/net/openthread/coprocessor -- \
118+
-DCONF_FILE="prj.conf overlay-rcp.conf" \
119+
-DDTC_OVERLAY_FILE="usb.overlay" \
120+
-DEXTRA_CONF_FILE="overlay-usb-nrf-br.conf"
121+
122+
- name: Collect artifacts (hex/bin/uf2 if present)
123+
shell: bash
124+
run: |
125+
set -euo pipefail
126+
mkdir -p out
127+
128+
collect() {
129+
local builddir="$1"
130+
local name="$2"
131+
132+
cp "${builddir}/zephyr/zephyr.hex" "out/${name}.hex"
133+
cp "${builddir}/zephyr/zephyr.bin" "out/${name}.bin"
134+
135+
# UF2 is not always produced for every board; copy if it exists.
136+
if [ -f "${builddir}/zephyr/zephyr.uf2" ]; then
137+
cp "${builddir}/zephyr/zephyr.uf2" "out/${name}.uf2"
138+
fi
139+
}
140+
141+
collect "${{ github.workspace }}/build/ot-cli-ftd-UART" "ot-cli-ftd-UART"
142+
collect "${{ github.workspace }}/build/ot-cli-ftd-USB" "ot-cli-ftd-USB"
143+
collect "${{ github.workspace }}/build/ot-rcp-USB" "ot-rcp-USB"
144+
145+
ls -lah out
146+
147+
- name: Upload artifacts
148+
uses: actions/upload-artifact@v4
149+
with:
150+
name: raytac-mdbt50q-cx-40-openthread
151+
path: out/*
152+

0 commit comments

Comments
 (0)