diff options
author | Jos Verlinde <Jos.Verlinde@Microsoft.com> | 2022-12-27 13:56:58 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-01-13 16:51:31 +1100 |
commit | d263438a6e365d3199494498a9b734cda29dde52 (patch) | |
tree | 8953f0cc8076d431b9e97bd2fd40860aabae6d33 /tools/pyboard.py | |
parent | aa64280666d40208ade0183503fe683fbb32c2ab (diff) |
tools/pyboard.py: Set DTR on Windows to avoid ESPxx hard reset.
Fixes issue #9659.
Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-x | tools/pyboard.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py index d1abd2b78..d0e67d1f3 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -286,7 +286,15 @@ class Pyboard: delayed = False for attempt in range(wait + 1): try: - self.serial = serial.Serial(device, **serial_kwargs) + if os.name == "nt": + # Windows does not set DTR or RTS by default + self.serial = serial.Serial(**serial_kwargs) + self.serial.dtr = True + self.serial.rts = False + self.serial.port = device + self.serial.open() + else: + self.serial = serial.Serial(device, **serial_kwargs) break except (OSError, IOError): # Py2 and Py3 have different errors if wait == 0: |