Skip to content

host/dfu: don't sleep bwPollTimeout after the first DNBUSY - #69

Merged
andoma merged 1 commit into
masterfrom
andoma/dfu-skip-poll-sleep
Oct 30, 2026
Merged

andoma merged 1 commit into
masterfrom
andoma/dfu-skip-poll-sleep

Conversation

@andoma

@andoma andoma commented Oct 30, 2026

Copy link
Copy Markdown
Owner

The STM32 ROM bootloaders perform the erase/program inside the GETSTATUS that follows a DNLOAD, so sleeping the reported poll timeout first only adds latency: on an STM32F4 every 2 KB write chunk took 104 ms, of which ~33 ms was the programming. Poll again at once and sleep only if the device is still busy. Measured on an F4 (lynxpdu) and an H7 (pmd): the image write drops from 12.7 s to 4.4 s and from 3.4 s to 1.3 s.

The STM32 ROM bootloaders perform the erase/program inside the GETSTATUS
that follows a DNLOAD, so sleeping the reported poll timeout first only
adds latency: on an STM32F4 every 2 KB write chunk took 104 ms, of which
~33 ms was the programming. Poll again at once and sleep only if the
device is still busy. Measured on an F4 (lynxpdu) and an H7 (pmd): the
image write drops from 12.7 s to 4.4 s and from 3.4 s to 1.3 s.

Co-Authored-By: Claude <noreply@anthropic.com>
@andoma
andoma merged commit 65f62de into master Oct 30, 2026
1 check passed
@andoma
andoma deleted the andoma/dfu-skip-poll-sleep branch October 30, 2026 05:51
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.

1 participant