Skip to content

Commit 0950f65

Browse files
agattidpgeorge
andcommitted
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 <[email protected]> Signed-off-by: Alessandro Gatti <[email protected]>
1 parent d533c90 commit 0950f65

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/pyboard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ def __init__(self, cmd):
244244
self.close()
245245
sys.exit(1)
246246
pty = m.group()
247+
# Compensate for some boards taking a bit longer to start
248+
time.sleep(0.1)
247249
# rtscts, dsrdtr params are to workaround pyserial bug:
248250
# http://stackoverflow.com/questions/34831131/pyserial-does-not-play-well-with-virtual-port
249251
self.serial = serial.Serial(pty, interCharTimeout=1, rtscts=True, dsrdtr=True)

0 commit comments

Comments
 (0)