Skip to content

fix: do not warn when the USB port goes away after reset - #71

Merged
deadprogram merged 1 commit into
mainfrom
fix/usb-reset-port-gone
Oct 24, 2026
Merged

deadprogram merged 1 commit into
mainfrom
fix/usb-reset-port-gone

Conversation

@deadprogram

Copy link
Copy Markdown
Member

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.

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.
@deadprogram
deadprogram merged commit 82653de into main Oct 24, 2026
3 checks passed
@deadprogram
deadprogram deleted the fix/usb-reset-port-gone branch October 24, 2026 09:18
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