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
1276cc7b
authored
Jan 30, 2020
by
Enrico Pozzobon
Committed by
lwc-tester
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ft2232H + openocd bluepill template
parent
f8b9564e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
21 deletions
+44
-21
README.md
+9
-0
templates/bluepill/openocd.cfg
+25
-0
templates/bluepill/test
+10
-21
No files found.
README.md
0 → 100644
View file @
1276cc7b
#
## Requirements
```
sudo apt install python3-pip openocd
sudo pip3 install pyserial platformio saleae
sudo pip3 uninstall enum34
```
templates/bluepill/openocd.cfg
0 → 100644
View file @
1276cc7b
interface ftdi
transport select jtag
ftdi_device_desc "FT2232H MiniModule"
ftdi_vid_pid 0x0403 0x6010
# The other channel is used for UART
ftdi_channel 1
ftdi_layout_init 0x0018 0x05fb
# BDBUS4 is connected to JTAG TRST
ftdi_layout_signal nTRST -data 0x0010
# BDBUS5 is connected to System Reset
ftdi_layout_signal nSRST -data 0x0020
set WORKAREASIZE 0x2000
source [find target/stm32f1x.cfg]
#tpiu config internal swodump.stm32f103-generic.log uart off 72000000
#reset_config srst_only srst_push_pull srst_nogate connect_assert_srst
reset_config none srst_push_pull srst_nogate
templates/bluepill/test
View file @
1276cc7b
...
@@ -15,31 +15,20 @@ def eprint(*args, **kargs):
...
@@ -15,31 +15,20 @@ def eprint(*args, **kargs):
def
flash
():
def
flash
():
pipe
=
subprocess
.
PIPE
pipe
=
subprocess
.
PIPE
cmd
=
[
'platformio'
,
'run'
,
'-e'
,
'bluepill_f103c8'
,
'--target'
,
'upload'
]
cmd
=
[
'openocd'
,
'-f'
,
'openocd.cfg'
,
'-c'
'program '
+
'.pio/build/bluepill_f103c8/firmware.elf verify reset exit'
]
p
=
subprocess
.
Popen
(
cmd
,
p
=
subprocess
.
Popen
(
cmd
,
stdout
=
sys
.
stderr
,
stdin
=
pipe
)
stdout
=
sys
.
stderr
,
stdin
=
sys
.
stdout
)
stdout
,
stderr
=
p
.
communicate
(
""
)
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
():
def
fill_ram
():
p
=
popen_jlink
()
pipe
=
subprocess
.
PIPE
return
p
.
communicate
((
"""
cmd
=
[
'openocd'
,
'-f'
,
'openocd.cfg'
,
'-c'
'program '
+
h
'empty_ram.bin reset exit 0x20000000'
]
loadbin empty_ram.bin 0x20000000
p
=
subprocess
.
Popen
(
cmd
,
r
stdout
=
sys
.
stderr
,
stdin
=
sys
.
stdout
)
g
stdout
,
stderr
=
p
.
communicate
(
""
)
exit
"""
)
.
encode
(
'ascii'
))
def
get_serial
():
def
get_serial
():
...
...
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