summaryrefslogtreecommitdiff
path: root/tools/pyboard.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-xtools/pyboard.py10
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: