From d263438a6e365d3199494498a9b734cda29dde52 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Tue, 27 Dec 2022 13:56:58 +0100 Subject: [PATCH] tools/pyboard.py: Set DTR on Windows to avoid ESPxx hard reset. Fixes issue #9659. Signed-off-by: Jos Verlinde --- tools/pyboard.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/pyboard.py b/tools/pyboard.py index d1abd2b781044..d0e67d1f31cc1 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -286,7 +286,15 @@ def __init__( 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: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy