feat: COBS-framed raw serial recovery fixture (intercreate/mcuboot#5) - #12
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
serial_recovery_raw_cobs.mps2_an385: the do-it-all raw recovery image, but MCUboot serial recovery frames each raw SMP packet asCOBS(header ‖ payload ‖ CRC16) ‖ 0x00(CONFIG_BOOT_SERIAL_RAW_PROTOCOL_COBS) instead of sending it unframed. The trailing0x00makes 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).patchedand excluded from the mainlinebuildjob (--exclude-tag patched), so every other fixture stays built from pinned upstream module sources — no patched binaries leak into the mainline release.build-patchedjob applieswest patch apply(afteraction-zephyr-setup'swest update, which would otherwise reset modules to their pinned revisions) and builds only thepatched-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-scriptis device-flash only; nopatchkey in the testcase schema), sowest patch+ the isolated job is the mechanism.Collector
No change needed: the fixture is distinguished by its
serial_recovery_raw_cobsconfig name, and recovery still advertisesrecovery_buf_size=1024/recovery_buf_count=1(BOOT_MGMT_MCUMGR_PARAMS, inherited fromsysbuild/mcuboot_recovery.conf). The app keeps plainraw_serial(COBS is an MCUboot boot_serial feature).Verified locally (Zephyr SDK,
west twister, mps2/an385)west patch applyapplies 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).mcuboot/zephyr/.config:BOOT_SERIAL_RAW_PROTOCOL_COBS=y(the choice switched offINPUT_TIMEOUT),BOOT_SERIAL_MAX_RECEIVE_SIZE=1024,BOOT_MGMT_MCUMGR_PARAMS=y.config=serial_recovery_raw_cobs,transport=serial_raw,recovery_buf_size=1024,serial_recovery=true, runnableqemu_cmd.-sruns):--tag patched→ fixture builds;--exclude-tag patched→ fixture filtered out.🤖 Generated with Claude Code
https://claude.ai/code/session_01KKXy7L2Udjw929nie2c363