Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 64 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,16 @@ jobs:

- uses: astral-sh/setup-uv@v8.1.0

# No patches here: `--exclude-tag patched` drops fixtures needing an
# out-of-tree module patch so these stay on pinned upstream revisions. The
# build-patched job builds them in isolation.
- name: Build fixtures (Twister, all configs for this leg)
working-directory: working_directory
run: |
args=""
for p in ${{ matrix.platforms }}; do args="$args -p $p"; done
west twister -T apps --build-only --inline-logs -O twister-out $args
west twister -T apps --build-only --inline-logs -O twister-out $args \
--exclude-tag patched

- name: Collect fixtures with canonical names and a manifest
working-directory: working_directory
Expand Down Expand Up @@ -111,9 +115,67 @@ jobs:
name: twister-logs-${{ matrix.leg }}
path: working_directory/twister-out/**/build.log

# Builds the `patched`-tagged fixtures (only the COBS serial recovery one today,
# intercreate/mcuboot#5) in isolation from the mainline build, so a module patch
# touches only these binaries. west patch apply must run after action-zephyr-setup
# (its west update resets modules to pinned revisions) and before Twister.
build-patched:
name: Build patched fixtures (out-of-tree module patches)
needs: check-script
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
path: working_directory
persist-credentials: false

- uses: actions/setup-python@v6
with:
python-version: '3.13'

- uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: working_directory
toolchains: arm-zephyr-eabi
ccache-cache-key: patched

- uses: astral-sh/setup-uv@v8.1.0

- name: Apply out-of-tree patches (west patch)
working-directory: working_directory
run: west patch -l patches.yml -b patches apply

- name: Build patched fixtures (Twister, tag=patched)
working-directory: working_directory
run: >-
west twister -T apps --build-only --inline-logs -O twister-out
-p mps2/an385 --tag patched

- name: Collect fixtures with canonical names and a manifest
working-directory: working_directory
run: |
ver=$(west list zephyr --format='{revision}'); ver=${ver#v}
if [ "${#ver}" -ge 40 ]; then ver=${ver:0:12}; fi
uv run .github/scripts/collect_fixtures.py \
--git-sha "$GITHUB_SHA" --zephyr-version "$ver" \
--leg patched --twister-out twister-out --out-dir fixtures

- uses: actions/upload-artifact@v7
with:
name: fixtures-patched
path: working_directory/fixtures/*
if-no-files-found: error

- name: Upload Twister logs on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: twister-logs-patched
path: working_directory/twister-out/**/build.log

release:
name: Publish per-commit release (newest is the repo 'latest')
needs: build
needs: [build, build-patched]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-24.04
permissions:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ships a machine-readable [`manifest.json`](#manifest) describing every fixture.
| **`serial`** (roomy) | mps2 | Cortex-M3, 4 MB SRAM via a flash overlay: one runnable image with **every** non-img group, fs file round-trips, and large buffers. |
| **`serial_recovery`** | mps2 | Do-it-all MCUboot RAM_LOAD image — boots **straight into the full app** (every group incl. img) serving SMP on uart0 and logging on uart1. `os reset boot_mode=1` re-enters MCUboot **serial recovery** on demand; an upload there persists across the soft reset (slots live in a non-erased RAM-backed flash simulator). Recovery advertises the MCUmgr params command, so a client can negotiate buffers against the bootloader (see `recovery_buf_size`). Launched with two QEMU loaders: the MCUboot `.hex` plus the `.signed.bin` dropped into slot0. |
| **`serial_recovery_raw`** | mps2 | The `serial_recovery` image, but both MCUboot recovery and the app speak the **raw** (non-console) SMP serial encoding — no base64/CRC/console framing, packets framed by the SMP header length (`CONFIG_BOOT_SERIAL_RAW_PROTOCOL` + `CONFIG_UART_MCUMGR_RAW_PROTOCOL`). For testing a client's raw serial transport against a real recovery server. Same two-loader launch as `serial_recovery`. |
| **`serial_recovery_raw_cobs`** | mps2 | The `serial_recovery_raw` image, but MCUboot recovery wraps each raw SMP packet as `COBS(header ‖ payload ‖ CRC16) ‖ 0x00` (`CONFIG_BOOT_SERIAL_RAW_PROTOCOL_COBS`) — a self-synchronising, CRC-checked framing. Needs an out-of-tree MCUboot patch ([intercreate/mcuboot#5](https://github.com/intercreate/mcuboot/pull/5)) carried by [`patches.yml`](patches.yml); built by the isolated `build-patched` CI job so every other fixture stays on pinned upstream sources. The app stays plain raw. |
| **`serial`** | qemu_cortex_m0 | Merged MCUboot + signed app — exercises the img (DFU) group under emulation. |
| **`serial`, `ble`, `serial_recovery`** | nrf52840dk | Build-only images for a hardware bench. |

Expand Down
30 changes: 28 additions & 2 deletions apps/smp-server/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ tests:
integration_platforms: [mps2/an385]
extra_args:
- *mps2_doitall_suffix
- >-
- &mps2_doitall_raw_conf >-
EXTRA_CONF_FILE="raw_serial.conf;
grp_os.conf;
grp_fs.conf;
Expand All @@ -483,7 +483,33 @@ tests:
- *mps2_doitall_log
- *mps2_doitall_mcuboot_log
- *mps2_doitall_mcuboot_dbg
- mcuboot_CONFIG_BOOT_SERIAL_RAW_PROTOCOL=y
- &mps2_doitall_raw_protocol mcuboot_CONFIG_BOOT_SERIAL_RAW_PROTOCOL=y

# COBS-framed raw recovery: like serial_recovery_raw, but MCUboot wraps each raw
# SMP packet as COBS(header || payload || CRC16) || 0x00 (intercreate/mcuboot#5,
# not upstream -- patches.yml + the build-patched CI job carry it). The app stays
# plain raw_serial (COBS is an MCUboot boot_serial feature), so the test drives
# recovery. For smpclient's COBS raw transport.
smp_server.fixture.serial_recovery_raw_cobs.mps2_an385:
sysbuild: true
# `patched`: needs an out-of-tree module patch. The mainline build drops this
# tag (--exclude-tag); the build-patched job builds it (--tag) after west patch.
tags: [smp_server, fixture, patched]
platform_allow: [mps2/an385]
integration_platforms: [mps2/an385]
extra_args:
- *mps2_doitall_suffix
- *mps2_doitall_raw_conf
- *mps2_doitall_overlay
- *mps2_doitall_mcuboot
- *mps2_doitall_ramload
- *mps2_doitall_unsigned
- *mps2_doitall_hex
- *mps2_doitall_log
- *mps2_doitall_mcuboot_log
- *mps2_doitall_mcuboot_dbg
- *mps2_doitall_raw_protocol
- mcuboot_CONFIG_BOOT_SERIAL_RAW_PROTOCOL_COBS=y

# mps2/an385 buffer-size matrix on the do-it-all RAM_LOAD image: the same
# every-group-incl-img recovery fixture above, swept across
Expand Down
12 changes: 12 additions & 0 deletions patches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
checkout-command: git checkout .
clean-command: git clean -d -f -x
patches:
- author: JP Hutchins
date: '2026-06-24'
email: hidden@github.com
merge-pr: https://github.com/intercreate/mcuboot/pull/5
merge-status: false
module: bootloader/mcuboot
path: boot-boot-serial-add-COBS-framing-for-raw-serial-recovery.patch
sha256sum: a2a60b134fabb07417a330cb77ec6a756c8a4927fbbbd9797b13670168468bd7
upstreamable: true
Loading