File tree 1 file changed +7
-3
lines changed 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -287,11 +287,15 @@ def __init__(
287
287
for attempt in range (wait + 1 ):
288
288
try :
289
289
if os .name == "nt" :
290
- # Windows does not set DTR or RTS by default
291
290
self .serial = serial .Serial (** serial_kwargs )
292
- self .serial .dtr = True
293
- self .serial .rts = False
294
291
self .serial .port = device
292
+ portinfo = list (serial .tools .list_ports .grep (device )) # type: ignore
293
+ if portinfo and portinfo [0 ].manufacturer != "Microsoft" :
294
+ # ESPxx boards and ESP32 boards use RTS/CTS for flashing and boot mode selection
295
+ # DTR False, to avoid using the reset button will hang the MCU in bootloader mode
296
+ # RTS False, to prevent pulses on rts on serial.close() that would POWERON_RESET an ESPxx
297
+ self .serial .dtr = False # DTR False = gpio0 High = Normal boot
298
+ self .serial .rts = False # RTS False = EN High = MCU enabled
295
299
self .serial .open ()
296
300
else :
297
301
self .serial = serial .Serial (device , ** serial_kwargs )
You can’t perform that action at this time.
0 commit comments