From 0950f65ac48bb8315a9ae51be0d4099432cad548 Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Fri, 6 Sep 2024 15:50:35 +0200 Subject: tools/pyboard.py: Wait a bit before accessing the PTY serial port. Some PTY targets, namely `NETDUINO2` and `MICROBIT` under Qemu, take a bit more time to present a REPL than usual. The pyboard tool is a bit too impatient and would bail out before any of those targets had a chance to respond to the raw REPL request. Co-authored-by: Damien George Signed-off-by: Alessandro Gatti --- tools/pyboard.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/pyboard.py') diff --git a/tools/pyboard.py b/tools/pyboard.py index 8459bcf655..dac51e7d6b 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -244,6 +244,8 @@ class ProcessPtyToTerminal: self.close() sys.exit(1) pty = m.group() + # Compensate for some boards taking a bit longer to start + time.sleep(0.1) # rtscts, dsrdtr params are to workaround pyserial bug: # http://stackoverflow.com/questions/34831131/pyserial-does-not-play-well-with-virtual-port self.serial = serial.Serial(pty, interCharTimeout=1, rtscts=True, dsrdtr=True) -- cgit v1.2.3