Skip to content

feat: advertise MCUmgr params from MCUboot serial recovery - #11

Merged
JPHutchins merged 1 commit into
mainfrom
feat/issue-10-recovery-mcumgr-params
Jun 24, 2026
Merged

feat: advertise MCUmgr params from MCUboot serial recovery#11
JPHutchins merged 1 commit into
mainfrom
feat/issue-10-recovery-mcumgr-params

Conversation

@JPHutchins

Copy link
Copy Markdown
Collaborator

Closes #10.

Enables MCUboot's serial-recovery MCUmgr params command (mcu-tools/mcuboot#2746, merged 5fa7077) on the existing recovery fixtures so a client can auto-negotiate serial fragmentation against the bootloader's recovery server instead of being told a buffer size out of band.

No new fixture variants, and no Zephyr/west bump — the pinned Zephyr (f33aa2bc → mcuboot 0fae8920) already contains the merged command; this is a fixture-config change only.

What changed

  • sysbuild/mcuboot_recovery.conf: CONFIG_BOOT_MGMT_MCUMGR_PARAMS=y, enabled once — covers every mps2 recovery fixture (do-it-all, raw, and the buffer matrix) via FILE_SUFFIX="recovery".
  • sample.yaml: the build-only serial_recovery.nrf52840dk image gets the option as an explicit mcuboot_CONFIG_ extra_arg (it doesn't use the recovery suffix). Comment on the buffer matrix records that the sweep is app-side only.
  • collect_fixtures.py: new manifest fields recovery_buf_size / recovery_buf_count, derived from the mcuboot image .config (CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE and a constant 1), null unless a recovery build has the command enabled. The collector only read the app .config before, so the recovery server's advertised size wasn't surfaced.
  • README: manifest field table + the serial_recovery row.

Design decisions (raised in #10)

  • Buffer matrix: the bootloader's advertised recovery buf_size (BOOT_SERIAL_MAX_RECEIVE_SIZE, default 1024) is held constant across the matrix. The matrix sweeps the app netbuf only; the recovery server is a separate server and the encoded/raw negotiation math is already linear, so sweeping it would add bootloader RAM per row for no extra coverage.
  • Manifest surfacing: added explicit recovery_buf_size / recovery_buf_count fields rather than documenting a constant, so the client test reads the advertised value from the manifest (SSOT) instead of hardcoding 1024. buf_count is a literal 1 in mcuboot's boot_serial.c (one command reassembled at a time), not a Kconfig.

Verification

Built both mps2 recovery fixtures locally (west twister -T apps -p mps2/an385, SDK 1.0.1):

  • both mcuboot/zephyr/.config carry CONFIG_BOOT_MGMT_MCUMGR_PARAMS=y, CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE=1024, CONFIG_BOOT_MAX_LINE_INPUT_LEN=128 (the command's dependency, intact even under BOOT_SERIAL_RAW_PROTOCOL=y);
  • running the collector over the build surfaces recovery_buf_size=1024, recovery_buf_count=1 for both encoded (serial) and raw (serial_raw) recovery, distinct from the app netbuf.

ruff check / ruff format --check / mypy --strict / pytest (incl. doctests) all green.

Enables

intercreate/smpclient#120 — integration coverage for the recovery negotiation path (re-vendors these fixtures once a release is cut).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KKXy7L2Udjw929nie2c363

Enable CONFIG_BOOT_MGMT_MCUMGR_PARAMS on the existing serial-recovery
fixtures (mcu-tools/mcuboot#2746) so a client can auto-negotiate serial
fragmentation against the bootloader's recovery server, instead of being
told a buffer size out of band. No new fixture variants and no Zephyr/west
bump: the pinned Zephyr (f33aa2bc -> mcuboot 0fae8920) already contains the
merged command; this is a fixture-config change only.

The option is enabled once in sysbuild/mcuboot_recovery.conf, which covers
every mps2 recovery fixture (do-it-all, raw, and the buffer matrix) via
FILE_SUFFIX="recovery"; the build-only nrf52840dk recovery image gets it as
an explicit mcuboot_CONFIG_ extra_arg. BOOT_MAX_LINE_INPUT_LEN stays at its
128 default everywhere (the command's dependency), including under the raw
protocol.

The recovery server advertises {BOOT_SERIAL_MAX_RECEIVE_SIZE, 1} -- a
decoded ceiling distinct from the app's CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE,
and the buffer matrix sweeps only the app netbuf (the bootloader's advertised
size is held constant). The collector reads only the app .config, so surface
the recovery server's params as new manifest fields recovery_buf_size /
recovery_buf_count, derived from the mcuboot image .config (null unless a
recovery build has the command enabled).

Verified by building the encoded and raw mps2 recovery fixtures: both
mcuboot .config carry CONFIG_BOOT_MGMT_MCUMGR_PARAMS=y and
CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE=1024, and the collector surfaces
recovery_buf_size=1024 / recovery_buf_count=1 for each.

Closes #10.

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 24, 2026 21:01

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 27c5483 into main Jun 24, 2026
4 checks passed
@JPHutchins
JPHutchins deleted the feat/issue-10-recovery-mcumgr-params branch June 24, 2026 22:02
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.

Enable MCUboot serial-recovery MCUmgr params command (CONFIG_BOOT_MGMT_MCUMGR_PARAMS) on the recovery fixtures

2 participants