Repository navigation
fix: do not warn when the USB port goes away after reset - #71
Merged
Merged
Conversation
On USB-JTAG/Serial the chip resets when RTS is asserted. An app that moves the USB PHY to USB-OTG removes the port before RTS is released, so the release write fails with broken pipe or input/output error even though the reset worked. Only report errors from the writes up to and including the reset edge on the USB path.
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.
On USB-JTAG/Serial the chip resets when RTS is asserted. An app that moves the USB PHY to USB-OTG, like the TinyGo ESP32-S3 usbotg build in tinygo-org/tinygo#6000, removes the port before RTS is released. The release write then fails with broken pipe or input/output error and espflasher prints "Warning: device may not have been reset" even though the reset worked.
This only reports errors from the writes up to and including the reset edge on the USB path. UART bridges still report a failed release, since the port stays and EN could be left low.
Tested on a XIAO ESP32-S3. Before, every flash ending in the usbotg build printed the warning. After, 5 flashes in a row between the default and usbotg builds all print "Device reset." and CDC echo works after the last one. The Windows hardResetUSB path is unchanged and untested.