esp-rs / espflash

Serial flasher utility for Espressif SoCs and modules based on esptool.py
Apache License 2.0
478 stars 117 forks source link

Windows USB serial workaround: set DTR after RTS #554

Closed haileys closed 8 months ago

haileys commented 8 months ago

When setting DTR before RTS, espflash can't connect to a USB serial device on Windows:

image

After changing the order, it can:

image

Strange but true!

esptool itself features a similar workaround - it additionally sets DTR to its last known state whenever RTS is set. For our purposes though, it seems good enough to just switch the order we set the pins.

SergioGasquez commented 8 months ago

I've also added the changes for UsbJtagSerialReset in https://github.com/SergioGasquez/espflash/tree/fix/windows-reset. Do you have by any chance a devkit with jtab port available by any chance to confirm if the issue is also present there and my changes fix it?