From f20b625a3e309298e32494a80860ababc4fa53a2 Mon Sep 17 00:00:00 2001 From: schneider <schneider@blinkenlichts.net> Date: Thu, 15 Oct 2020 02:51:33 +0200 Subject: [PATCH] fix(pycard10): Reliably trigger soft reset and enter raw REPL --- tools/pycard10.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/pycard10.py b/tools/pycard10.py index 820925d1..a0ce7419 100755 --- a/tools/pycard10.py +++ b/tools/pycard10.py @@ -129,6 +129,9 @@ class PyCard10(Pyboard): Returns: None """ + + self.soft_reset() + self.serial.write(b"\x03\x03") # ctrl-C twice: interrupt any running program # flush input (without relying on serial.flushInput()) @@ -169,10 +172,12 @@ class PyCard10(Pyboard): self.serial.write(b"\x03\x03") # ctrl-C twice: interrupt any running program - self.serial.write(b"\x01") # ctrl-B: ensue it's the normal mode + self.serial.write(b"\x02") # ctrl-B: ensue it's the normal mode self.serial.write(b"\x04") # ctrl-D: do the reset + time.sleep(1) # Give epicardium some time to cycle pycardium + n = self.serial.inWaiting() while n > 0: self.serial.read(n) -- GitLab