Skip to content

feat: raw (non-console) mcuboot serial-recovery fixture (mps2/an385)#9

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

feat: raw (non-console) mcuboot serial-recovery fixture (mps2/an385)#9
JPHutchins merged 1 commit into
mainfrom
feat/serial-recovery-raw

Conversation

@JPHutchins

Copy link
Copy Markdown
Collaborator

Closes #8.

Adds a raw (non-console) MCUboot serial-recovery fixture so smpclient's SMPSerialRawTransport can integration-test against a real recovery server (mcu-tools/mcuboot#2755, intercreate/smpclient#106).

What's added

smp_server.fixture.serial_recovery_raw.mps2_an385 — the do-it-all MCUboot RAM_LOAD recovery fixture, but both MCUboot recovery and the app speak the raw SMP serial encoding (no base64/CRC/console framing; packets framed by the SMP header length) instead of SMP-over-console:

  • App: serial.confraw_serial.conf (CONFIG_UART_MCUMGR_RAW_PROTOCOL) on uart0; ramload.conf stays last so it restores the uart1 console/log that raw_serial.conf turns off for single-UART targets.
  • MCUboot: mcuboot_CONFIG_BOOT_SERIAL_RAW_PROTOCOL=y — the bootloader counterpart of the app's raw transport.
  • Same two-loader RAM_LOAD scheme as the other serial_recovery_* fixtures (MCUboot code-only hex + signed app dropped into slot0's RAM-backed sim-flash).

Manifest entry comes out exactly as the issue requested: config: serial_recovery_raw, transport: serial_raw, mcuboot: true, serial_recovery: true, target mps2_an385, every group incl. img.

Target choice: built for mps2_an385 (per maintainer decision) — mirrors the existing recovery family and reuses all collector/qemu_cmd infra. Consuming it from smpclient additionally needs a socket-backed raw transport on the client side (the current SMPSerialRawTransport is wired for native_sim PTYs); tracked on the smpclient side.

Dependency: Zephyr bump

CONFIG_BOOT_SERIAL_RAW_PROTOCOL merged into MCUboot after v4.4.0's MCUboot pin, and it isn't in any released Zephyr yet. Per maintainer decision, west.yml now pins Zephyr to a main commit (f33aa2bc, post-v4.4.0) whose imported MCUboot (0fae8920) carries #2755.

  • All 34 fixtures still build under the bump (0 failed, 0 errored, 0 warnings), and no transport classification regressed to unknown.
  • build.yaml shortens a 40-char main SHA to 12 chars for the fixture-name version label (release tags stay verbatim), so names read zephyr_f33aa2bc4a43_… rather than the full 40-char SHA. Naming policy is a judgment call — easy to switch to 4.4.99 or the bare SHA if preferred.

Verification (local)

  • west twister builds the new fixture and the full suite (34/34).
  • QEMU boot: two-loader launch RAM-loads straight into the app; booting MCUboot alone (empty slot0) reaches "Enter the serial recovery mode".
  • Built .config confirms raw on both sides (UART_MCUMGR_RAW_PROTOCOL, BOOT_SERIAL_RAW_PROTOCOL) with console/log preserved on uart1.
  • Collector + release validator pass over the full asset set (34 entries / 44 assets). Script suite green: ruff, ruff format, mypy --strict, 77 pytest (incl. new doctest + process-test for serial_recovery_raw).

Not verified locally: a full raw-SMP upload round-trip — that needs smpclient's SMPSerialRawTransport (#106). Coverage here matches the existing recovery fixtures (build + boot + recovery-entry + manifest correctness).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PSmP6esfZppSaVdaj82KZu

Copilot AI review requested due to automatic review settings June 23, 2026 20:12

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.

Comment thread west.yml Outdated
Comment on lines +13 to +16
# Pinned to a zephyr main commit (post-v4.4.0) so the imported mcuboot
# carries mcu-tools/mcuboot#2755 -- the raw (non-console) SMP serial
# recovery protocol (CONFIG_BOOT_SERIAL_RAW_PROTOCOL) the serial_recovery_raw
# fixture needs. v4.4.0's mcuboot pin predates that feature.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Remove comment

Comment on lines +420 to +422
# Raw (non-console) variant of the do-it-all fixture: same two-loader RAM_LOAD
# scheme, but the app's transport is the raw UART protocol, so the manifest
# entry reports serial_raw while still being a serial-recovery mcuboot image.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Remove or convert to docstring

@JPHutchins JPHutchins left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

comment

@JPHutchins
JPHutchins force-pushed the feat/serial-recovery-raw branch from ae9b070 to 8dad4ee Compare June 23, 2026 20:21
Add smp_server.fixture.serial_recovery_raw.mps2_an385: the do-it-all
MCUboot RAM_LOAD recovery fixture, but both MCUboot recovery and the app
speak the raw SMP serial encoding (no base64/CRC/console framing) instead
of SMP-over-console -- so smpclient's SMPSerialRawTransport can
integration-test against a real recovery server (mcu-tools/mcuboot#2755,
intercreate/smpclient#106). It mirrors the existing serial_recovery_*
two-loader scheme: MCUboot's code-only hex plus the signed app dropped
into slot0's RAM-backed sim-flash. transport=serial_raw, mcuboot=true,
serial_recovery=true in the manifest.

The raw recovery protocol (CONFIG_BOOT_SERIAL_RAW_PROTOCOL) merged into
mcuboot after v4.4.0's pin, so bump zephyr to a pinned main commit
(f33aa2bc, post-v4.4.0) whose imported mcuboot (0fae8920) carries it.
All 34 fixtures still build under the bump. A 40-char main SHA is
shortened to 12 chars for fixture names so they stay readable.

Closes #8

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSmP6esfZppSaVdaj82KZu
@JPHutchins
JPHutchins merged commit c8f44c4 into main Jun 23, 2026
4 checks passed
@JPHutchins
JPHutchins deleted the feat/serial-recovery-raw branch June 23, 2026 20:37
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.

Build a raw (non-console) MCUboot serial-recovery fixture

2 participants