Skip to content

feat: COBS-framed raw serial recovery fixture (intercreate/mcuboot#5) - #12

Merged
JPHutchins merged 1 commit into
mainfrom
feat/serial-recovery-raw-cobs
Jun 25, 2026
Merged

feat: COBS-framed raw serial recovery fixture (intercreate/mcuboot#5)#12
JPHutchins merged 1 commit into
mainfrom
feat/serial-recovery-raw-cobs

Conversation

@JPHutchins

Copy link
Copy Markdown
Collaborator

Adds serial_recovery_raw_cobs.mps2_an385: the do-it-all raw recovery image, but MCUboot serial recovery frames each raw SMP packet as COBS(header ‖ payload ‖ CRC16) ‖ 0x00 (CONFIG_BOOT_SERIAL_RAW_PROTOCOL_COBS) instead of sending it unframed. The trailing 0x00 makes the byte stream self-synchronising and the CRC-16/XMODEM rejects damaged packets. For exercising a client's COBS raw serial transport (smpclient) against a real recovery server.

Out-of-tree patch, isolated build

COBS is not upstream MCUboot — it's a draft, intercreate/mcuboot#5 (layered on mcu-tools/mcuboot#2755). So:

  • patches.yml + patches/ carry the PR as a patch (west patch gh-fetch -o intercreate -r mcuboot -pr 5 -m bootloader/mcuboot).
  • The fixture is tagged patched and excluded from the mainline build job (--exclude-tag patched), so every other fixture stays built from pinned upstream module sources — no patched binaries leak into the mainline release.
  • A dedicated build-patched job applies west patch apply (after action-zephyr-setup's west update, which would otherwise reset modules to their pinned revisions) and builds only the patched-tagged fixtures (--tag patched) in an isolated workspace. Its manifest merges into the release like any other leg.

Twister has no per-scenario patch mechanism (--pre-script is device-flash only; no patch key in the testcase schema), so west patch + the isolated job is the mechanism.

Collector

No change needed: the fixture is distinguished by its serial_recovery_raw_cobs config name, and recovery still advertises recovery_buf_size=1024 / recovery_buf_count=1 (BOOT_MGMT_MCUMGR_PARAMS, inherited from sysbuild/mcuboot_recovery.conf). The app keeps plain raw_serial (COBS is an MCUboot boot_serial feature).

Verified locally (Zephyr SDK, west twister, mps2/an385)

  • west patch apply applies Need a reliable non-bursty large-buffer target (mps2 buffer matrix) for real buffer-fill tests #5 cleanly to the pinned mcuboot; the fixture builds (exit 0).
  • Built mcuboot/zephyr/.config: BOOT_SERIAL_RAW_PROTOCOL_COBS=y (the choice switched off INPUT_TIMEOUT), BOOT_SERIAL_MAX_RECEIVE_SIZE=1024, BOOT_MGMT_MCUMGR_PARAMS=y.
  • Collector emits the entry: config=serial_recovery_raw_cobs, transport=serial_raw, recovery_buf_size=1024, serial_recovery=true, runnable qemu_cmd.
  • Tag filtering (controlled -s runs): --tag patched → fixture builds; --exclude-tag patched → fixture filtered out.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KKXy7L2Udjw929nie2c363

Add serial_recovery_raw_cobs.mps2_an385: the do-it-all raw recovery image,
but MCUboot serial recovery frames each raw SMP packet as
COBS(header || payload || CRC16) || 0x00 instead of sending it unframed
(CONFIG_BOOT_SERIAL_RAW_PROTOCOL_COBS). For exercising a client's COBS raw
serial transport against a real recovery server.

COBS is not upstream MCUboot, so patches.yml carries intercreate/mcuboot#5
(west patch gh-fetch). To keep every other fixture on pinned upstream
sources, the patch is NOT applied to the main build: the fixture is tagged
`patched` and excluded from the mainline build (--exclude-tag), and a
dedicated build-patched CI job applies `west patch apply` and builds only
the `patched`-tagged fixtures (--tag) in an isolated workspace.

The collector needs no change -- the fixture is distinguished by its
serial_recovery_raw_cobs config name, and recovery still advertises
buf_size=1024/buf_count=1 (BOOT_MGMT_MCUMGR_PARAMS, from mcuboot_recovery.conf).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KKXy7L2Udjw929nie2c363
Copilot AI review requested due to automatic review settings June 25, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@JPHutchins
JPHutchins merged commit fa39f8c into main Jun 25, 2026
5 checks passed
@JPHutchins
JPHutchins deleted the feat/serial-recovery-raw-cobs branch June 25, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants