diff options
author | Dave Hylands <dhylands@gmail.com> | 2015-12-03 16:05:53 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-12-06 21:45:10 +0000 |
commit | 519cef813eff8a44d8f112cce5bcb07008ddbc98 (patch) | |
tree | 932804a017d8af30ea50defcf9049ff82471bfcb /tools/pyboard.py | |
parent | cbc489dff5e6bac00413d818cc55d044dbd75264 (diff) | |
download | micropython-519cef813eff8a44d8f112cce5bcb07008ddbc98.tar.gz micropython-519cef813eff8a44d8f112cce5bcb07008ddbc98.zip |
tools: Allow pyboard.py to work when boot.py prints things.
Diffstat (limited to 'tools/pyboard.py')
-rwxr-xr-x | tools/pyboard.py | 10 |
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') |