Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lwc
/
compare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b5fadc28
authored
Jul 28, 2019
by
Enrico Pozzobon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bluepill template improvements
parent
1f7473d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletions
+24
-1
templates/bluepill/configure
+1
-1
templates/bluepill/empty_ram.bin
+0
-0
templates/bluepill/test
+23
-0
No files found.
templates/bluepill/configure
View file @
b5fadc28
#!/bin/bash
mv
-n
*
.c
*
.s
*
.S src/
mv
-n
*
.dat
*
.inc
*
.h include/
sed
-i
src/encrypt.c
-e
"s/
\(\s\)
init(/
\1
_init(/g"
sed
-i
src/encrypt.c
-e
"s/
\(\s\)
init(/
\1
encrypt
_init(/g"
exit
0
templates/bluepill/empty_ram.bin
0 → 100644
View file @
b5fadc28
File added
templates/bluepill/test
View file @
b5fadc28
...
...
@@ -20,6 +20,28 @@ def flash():
stdout
=
sys
.
stderr
,
stdin
=
pipe
)
stdout
,
stderr
=
p
.
communicate
(
""
)
def
popen_jlink
():
pipe
=
subprocess
.
PIPE
cmd
=
[
'JLinkExe'
]
cmd
.
extend
([
'-autoconnect'
,
'1'
])
cmd
.
extend
([
'-device'
,
'STM32F103C8'
])
cmd
.
extend
([
'-if'
,
'swd'
])
cmd
.
extend
([
'-speed'
,
'4000'
])
return
subprocess
.
Popen
(
cmd
,
stdout
=
sys
.
stderr
,
stdin
=
pipe
)
def
fill_ram
():
p
=
popen_jlink
()
return
p
.
communicate
((
"""
h
loadbin empty_ram.bin 0x20000000
r
g
exit
"""
)
.
encode
(
'ascii'
))
def
get_serial
():
import
serial.tools.list_ports
ports
=
serial
.
tools
.
list_ports
.
comports
()
...
...
@@ -113,6 +135,7 @@ def main(argv):
uartp
=
UARTP
(
ser
)
flash
()
fill_ram
()
eprint
(
"Flashed"
)
time
.
sleep
(
0.1
)
...
...
Write
Preview
Markdown
is supported
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