Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Øyvind Kolås
firmware
Commits
7befa10d
Commit
7befa10d
authored
Oct 15, 2020
by
Rahix
Browse files
Merge 'pycard10: Reliably trigger soft reset and enter raw REPL'
See merge request
card10/firmware!416
parents
56b73d41
f20b625a
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/pycard10.py
View file @
7befa10d
...
...
@@ -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
"
\x0
1
"
)
# ctrl-B: ensue it's the normal mode
self
.
serial
.
write
(
b
"
\x0
2
"
)
# 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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment