Repository navigation
fix(system): the System Console releases the device before it resets into the bootloader - #920
Merged
Merged
Conversation
…into the bootloader
A host that keeps a USB device open and claimed while the chip resets into
the ROM bootloader (a WebUSB interface with an IN transfer pending) can leave
the host -- macOS in particular -- holding a stale record of it, so the ROM's
USB device never enumerates until the board is replugged: the reboot looks
like a hang. Seen with a WebUSB console that asked for the reset 250 ms out
and kept the device open.
- system_console.html: a bootloader reboot asks for at least 1000 ms and
closes the device (monitor stream stopped, interface released) as soon as
the OK arrives.
- README ("Host side: release the device before it resets"), system.rst and
the protocol header document the rule for anyone implementing a host.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU
|
✅Static analysis result - no issues found! ✅ |
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.
Description
Rebooting a USB device into the ROM bootloader from a browser console can look like a hang: the device never shows up as the ROM's USB device until it is unplugged and plugged back in.
The cause is the host keeping the device open and claimed while the chip resets: a WebUSB interface with an IN transfer pending, here. The host (macOS, in particular) is then left holding a stale record of it, and the ROM's device, which has different ids, does not enumerate. It was seen with a console that asked for the reset 250 ms out and kept the device open. A command-line client that closed its handle before the reset fired worked every time.
system_console.html: a bootloader reboot now asks for a delay of at least 1000 ms. As soon as the OK arrives, the page disconnects: it stops the monitor stream, releases the interface and closes the device. A plain reboot is unchanged, since it comes back with the same ids and auto-reconnect picks it up.system.rstREBOOT_TO_BOOTLOADERindetail/system_protocol.hppHow has this been tested?
303a:0009) came up and a full flash over Web Serial succeeded.node components/dispatcher/web/test/resolve_module_id_test.jspasses (the shared blocks are untouched)system_host_testpassesTypes of changes
Checklist:
.github/workflows/build.ymlfile to add my new test to the automated cloud build github action.🤖 Generated with Claude Code
https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU