summaryrefslogtreecommitdiffstatshomepage
path: root/tools/pyboard.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-xtools/pyboard.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py
index 92c8d939a0..510f61be69 100755
--- a/tools/pyboard.py
+++ b/tools/pyboard.py
@@ -165,8 +165,14 @@ class Pyboard:
raise PyboardError('could not enter raw repl')
self.serial.write(b'\x04') # ctrl-D: soft reset
- data = self.read_until(1, b'soft reboot\r\nraw REPL; CTRL-B to exit\r\n')
- if not data.endswith(b'soft reboot\r\nraw REPL; CTRL-B to exit\r\n'):
+ data = self.read_until(1, b'soft reboot\r\n')
+ if not data.endswith(b'soft reboot\r\n'):
+ print(data)
+ raise PyboardError('could not enter raw repl')
+ # By splitting this into 2 reads, it allows boot.py to print stuff,
+ # which will show up after the soft reboot and before the raw REPL.
+ data = self.read_until(1, b'raw REPL; CTRL-B to exit\r\n')
+ if not data.endswith(b'raw REPL; CTRL-B to exit\r\n'):
print(data)
raise PyboardError('could not enter raw repl')