Repository navigation
fix(flash): give up a flash that makes no progress for 30 s - #592
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 46 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Jschmiedd
force-pushed
the
fix/flash-stall-watchdog
branch
from
November 11, 2026 21:02
34f5f1a to
1077577
Compare
When the power of the ESC is cut during a flash, every command is retried with a growing delay, and the retries of the commands and of the verification steps stack up: the flash can wait for many minutes before failing, with all buttons disabled. Add a watchdog around writeHex(): when the ESC has not answered (any ACK_OK except the keep alive, which the flight controller answers) and the progress bar has not moved for 30 s, the flash is given up. A command still waiting for an answer stops waiting, no further command is sent and retry() stops at once. The ESC is left as after any failed flash: marked FLASH*FAILED and recoverable by flashing it again. A healthy flash, even a slow one, gets an answer at least every second. The 30 s threshold is a proposal, open to discussion. Tests: a simulated ESC whose power is cut at 8 points over the whole flash, answering with a timeout or not at all: the flash now gives up within 60 s and resolves to null. A slow but healthy ESC (900 ms per answer) is flashed completely and never given up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvqUCt5QANL2A4NKbRdzyx
Jschmiedd
force-pushed
the
fix/flash-stall-watchdog
branch
from
November 11, 2026 21:33
1077577 to
2fc1f1c
Compare
Jschmiedd
marked this pull request as ready for review
November 13, 2026 22:16
stylesuxx
requested changes
Nov 14, 2026
…ll message Review of stylesuxx#592: the error class and the stall constant explain themselves, and the log message now reads "Gave up flashing ESC {{index}} - no progress for {{seconds}} s, check the ESC power". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvqUCsXEtnF7V6bZuqbME7
Jschmiedd
pushed a commit
to Jschmiedd/esc-configurator
that referenced
this pull request
Nov 14, 2026
As asked in the review of stylesuxx#590 and stylesuxx#592: no comment where the code is explicit enough. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvqUCsXEtnF7V6bZuqbME7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvqUCsXEtnF7V6bZuqbME7
stylesuxx
approved these changes
Nov 16, 2026
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.
Builds on #588 (an async retry function that throws must reject, and flashTarget() is awaited so that a failing flash resolves to null).
When the power of the ESC is cut during a flash, every command is retried with a growing delay, and the retries of the commands and of the verification steps stack up: the flash can wait for many minutes before failing, with all buttons disabled.
Add a watchdog around writeHex(): when the ESC has not answered (any ACK_OK except the keep alive, which the flight controller answers) and the progress bar has not moved for 30 s, the flash is given up. A command still waiting for an answer stops waiting, no further command is sent and retry() stops at once. The ESC is left as after any failed flash: marked FLASH*FAILED and recoverable by flashing it again. A healthy flash, even a slow one, gets an answer at least every second. The 30 s threshold is a proposal, open to discussion.
Tests: a simulated ESC whose power is cut at 8 points over the whole flash, answering with a timeout or not at all: the flash now gives up within 60 s and resolves to null. A slow but healthy ESC (900 ms per answer) is flashed completely and never given up.