Skip to content

docs: add serial recovery throughput tuning guide#2640

Open
JayToltTech wants to merge 1 commit into
mcu-tools:mainfrom
Tolt-Technologies:docs/serial-recovery-throughput
Open

docs: add serial recovery throughput tuning guide#2640
JayToltTech wants to merge 1 commit into
mcu-tools:mainfrom
Tolt-Technologies:docs/serial-recovery-throughput

Conversation

@JayToltTech
Copy link
Copy Markdown
Contributor

@JayToltTech JayToltTech commented Feb 21, 2026

Summary

  • Document the Kconfig options that control serial recovery upload throughput (CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE, CONFIG_BOOT_MAX_LINE_INPUT_LEN, CONFIG_BOOT_LINE_BUFS)
  • Show how to pass a matching MTU in the mcumgr connstring
  • Include measured upload times on nRF52840 over USB CDC-ACM (1 KB/s default vs 4 KB/s with mtu=4096)

Copilot AI review requested due to automatic review settings February 21, 2026 02:13
@JayToltTech JayToltTech requested a review from d3zd3z as a code owner February 21, 2026 02:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation to help users tune serial recovery upload throughput by aligning device-side receive buffers with host-side mcumgr MTU settings, including example timings for USB CDC-ACM on nRF52840.

Changes:

  • Document Zephyr-related Kconfig options affecting SMP receive buffering.
  • Provide a mcumgr example using a larger mtu to increase throughput.
  • Add a small results table showing measured upload time improvements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/serial_recovery.md Outdated
Comment thread docs/serial_recovery.md Outdated
@JayToltTech JayToltTech force-pushed the docs/serial-recovery-throughput branch from 67c31d0 to 97e115d Compare February 21, 2026 02:17
Comment thread docs/serial_recovery.md
How to enable and configure the serial recovery feature depends on the given mcuboot-port implementation.
Refer to the respective documentation and source code for more details.

## Throughput tuning
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a generic MCUboot doc page, the parts added here are zephyr specific, they cannot go on this page and would need to go on a separate page or under a separate heading - thoughts on which @de-nordic @d3zd3z ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think putting them in readme-zephyr.md makes sense here.

@de-nordic de-nordic added area: zephyr Affects the Zephyr port area: docs Affects the documentation labels Feb 26, 2026
@JayToltTech JayToltTech force-pushed the docs/serial-recovery-throughput branch from 97e115d to 9fbfd49 Compare March 9, 2026 17:38
@JayToltTech
Copy link
Copy Markdown
Contributor Author

@nordicjm Per conversation on the last MCUBoot call, I have moved the doc edits into docs/readme-zephyr.md.

@JayToltTech JayToltTech force-pushed the docs/serial-recovery-throughput branch from 9fbfd49 to fb9611c Compare March 9, 2026 17:51
Comment thread docs/readme-zephyr.md Outdated
@JayToltTech JayToltTech force-pushed the docs/serial-recovery-throughput branch 2 times, most recently from 0c5bbd9 to 4adbe71 Compare March 12, 2026 14:15
@d3zd3z
Copy link
Copy Markdown
Member

d3zd3z commented Mar 17, 2026

@de-nordic Thanks to some weird decisions by github, you will need to either actually "approve" this change, or an admin will need to dismiss your change request. Any preference?

@d3zd3z d3zd3z requested a review from nordicjm March 17, 2026 22:50
@de-nordic
Copy link
Copy Markdown
Collaborator

de-nordic commented Mar 18, 2026

@de-nordic Thanks to some weird decisions by github, you will need to either actually "approve" this change, or an admin will need to dismiss your change request. Any preference?

@d3zd3z We can add automatic dismiss of reviews on changes pushed to commit, but I do not know whether that fixes the issue.

Comment thread docs/readme-zephyr.md Outdated
Comment on lines +267 to +268
(8 buffers × 128 = 1024), each upload request carries roughly 228 bytes of
image data after base64 and CBOR overhead.
Copy link
Copy Markdown
Collaborator

@nordicjm nordicjm Mar 18, 2026

Choose a reason for hiding this comment

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

this does not seem right, if you send 1024 bytes of data (total size after SMP over console) then you get the following in the first request (for a dummy file I have):

  • 4-byte Length
  • 32-byte SHA256 hash
  • 0 byte offset
  • 633 data bytes

so something is amiss if you are only get 228 bytes here

Comment thread docs/readme-zephyr.md Outdated
On the host side, pass a matching MTU in the ``mcumgr`` connstring:

``` console
mcumgr --conntype serial --connstring "dev=/dev/ttyACM0,baud=115200,mtu=4096" image upload <image>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

never use this garbage tool

The serial recovery documentation did not mention the Kconfig options
that control upload throughput (BOOT_SERIAL_MAX_RECEIVE_SIZE,
BOOT_MAX_LINE_INPUT_LEN, BOOT_LINE_BUFS) or the host-side --mtu flag.

With defaults, each SMP round-trip carries only ~228 bytes of image
data, making large uploads unnecessarily slow. Document how to increase
buffer sizes and pass a matching MTU for significantly faster uploads.

Signed-off-by: Jay <jay@tolt.us>
@JayToltTech JayToltTech force-pushed the docs/serial-recovery-throughput branch from 4adbe71 to 4398701 Compare April 14, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Affects the documentation area: zephyr Affects the Zephyr port

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants