Skip to content

fix: double hard-reset for USB devices on Windows#30

Merged
deadprogram merged 1 commit intomainfrom
windows-restart
Apr 14, 2026
Merged

fix: double hard-reset for USB devices on Windows#30
deadprogram merged 1 commit intomainfrom
windows-restart

Conversation

@deadprogram
Copy link
Copy Markdown
Member

@deadprogram deadprogram commented Apr 14, 2026

On Windows, a single RTS toggle via the serial library is not sufficient to reset USB CDC devices (e.g. ESP32-S3 USB-JTAG/Serial). Performing two hard-resets in sequence (non-USB timing then USB timing) reliably triggers the chip to restart.

Add platform-specific hardResetUSB: on Windows it performs the double reset; on Linux/macOS it delegates to the standard hardReset with USB timing which already works correctly.

Also remove unused isNativeUSBPort function.

@deadprogram deadprogram force-pushed the windows-restart branch 4 times, most recently from 4f3cf80 to 8cc15f9 Compare April 14, 2026 15:37
On Windows, a single RTS toggle via the serial library is not
sufficient to reset USB CDC devices (e.g. ESP32-S3 USB-JTAG/Serial).
Performing two hard-resets in sequence (non-USB timing then USB timing)
reliably triggers the chip to restart.

Add platform-specific hardResetUSB: on Windows it performs the double
reset; on Linux/macOS it delegates to the standard hardReset with USB
timing which already works correctly.
@deadprogram deadprogram changed the title fix: use software reboot for USB devices on Windows after flashing fix: double hard-reset for USB devices on Windows Apr 14, 2026
@deadprogram deadprogram merged commit 2744d8e into main Apr 14, 2026
3 checks passed
@deadprogram deadprogram deleted the windows-restart branch April 14, 2026 17:14
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