Skip to content

break out of dfu_make_idle retry loop upon success#442

Merged
brentfpage merged 1 commit intomasterfrom
dfu_make_idle_loop_breakout
Apr 21, 2026
Merged

break out of dfu_make_idle retry loop upon success#442
brentfpage merged 1 commit intomasterfrom
dfu_make_idle_loop_breakout

Conversation

@brentfpage
Copy link
Copy Markdown
Contributor

This PR fixes a bug in the Android-specific stage of firmware flashing that runs dfu_make_idle. Both pre-PR and in the PR, a loop is used to allow for retries in case the dfu_make_idle call fails. However, in the pre-PR code, the loop isn't broken when dfu_make_idle is successful. In the PR, the bool made_idle is used to break the loop upon success. It seems that standard bools aren't available for the adopted C dialect, so I used the dfu_bool type from dfu-programmer.

I figure I'll also take this opportunity to document that the first call to dfu_make_idle fails with status->bStatus: errSTALLEDPKT (0x0f) and status->bState: dfuERROR, but the second try goes through just fine, flashing proceeds, and the firmware gets successfully uploaded.

@brentfpage brentfpage added the OS:Android Labrador on this OS label Apr 17, 2026
@EspoTek
Copy link
Copy Markdown
Collaborator

EspoTek commented Apr 21, 2026

I have no idea what this means but I'll take your word for it, haha. Ship it!

@brentfpage brentfpage merged commit 8719038 into master Apr 21, 2026
8 of 9 checks passed
@brentfpage
Copy link
Copy Markdown
Contributor Author

Hahha, I promise it's beneficial!

@brentfpage brentfpage deleted the dfu_make_idle_loop_breakout branch April 23, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OS:Android Labrador on this OS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants