feat: advertise MCUmgr params from MCUboot serial recovery - #11
Merged
Conversation
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
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.
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→ mcuboot0fae8920) 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) viaFILE_SUFFIX="recovery".sample.yaml: the build-onlyserial_recovery.nrf52840dkimage gets the option as an explicitmcuboot_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 fieldsrecovery_buf_size/recovery_buf_count, derived from the mcuboot image.config(CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZEand a constant1),nullunless a recovery build has the command enabled. The collector only read the app.configbefore, so the recovery server's advertised size wasn't surfaced.serial_recoveryrow.Design decisions (raised in #10)
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.recovery_buf_size/recovery_buf_countfields rather than documenting a constant, so the client test reads the advertised value from the manifest (SSOT) instead of hardcoding 1024.buf_countis a literal1in mcuboot'sboot_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):mcuboot/zephyr/.configcarryCONFIG_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 underBOOT_SERIAL_RAW_PROTOCOL=y);recovery_buf_size=1024,recovery_buf_count=1for 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