-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathplatformio.ini
80 lines (78 loc) · 3.34 KB
/
platformio.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:nucleo_f103rb]
platform = ststm32
board = nucleo_f103rb
build_flags = -DF1
framework = stm32cube
; add "Custom" -> "SWO Viewer" project task
extra_scripts = pre:add_swo_viewer.py
; set SWO trace clock in frequency to configured HCLK frequency
; in this example, board is clocked via HSI to 64MHz.
; if this number is wrong, there will be no output.
swo_trace_clkin_freq = 64000000
; if you want to see SWO outputs during debugging, a custom
; debug server invocation must be used.
; adapt interface and target accordingly.
; this entails changing the traceclk parameter to match
; the swo_trace_clkin_freq above.
; the SWO pin frequency param is irrelevant, since we are forwarding to
; tcl_trace, but OpenOCD will otherwise fail to enable the TPIU.
; this is used when starting debugging, not in the SWO Viewer task.
; after debugging starts, one must manually start the swo_viewer.py with
; python swo_parser.py --dont-run
debug_server = $PLATFORMIO_CORE_DIR/packages/tool-openocd/bin/openocd
-f $PLATFORMIO_CORE_DIR/packages/tool-openocd/scripts/interface/stlink.cfg
-f $PLATFORMIO_CORE_DIR/packages/tool-openocd/scripts/target/stm32f1x.cfg
-c "tpiu create nucleo_f103rb.tpiu -dap nucleo_f103rb.dap -ap-num 0"
-c "nucleo_f103rb.tpiu configure -protocol uart"
-c "nucleo_f103rb.tpiu configure -output -"
-c "nucleo_f103rb.tpiu configure -traceclk 64000000"
-c "nucleo_f103rb.tpiu configure -pin-freq 2000000"
-c "nucleo_f103rb.tpiu configure -formatter 0"
-c "itm ports on"
-c "nucleo_f103rb.tpiu enable"
-c "tcl_port 6666"
[env:blackpill_f401cc]
platform = ststm32
board = blackpill_f401cc
build_flags = -DF4
framework = stm32cube
debug_tool = stlink
upload_protocol = stlink
; add "Custom" -> "SWO Viewer" project task
extra_scripts = pre:add_swo_viewer.py
; set SWO trace clock in frequency to configured HCLK frequency
; in this example, board is clocked via HSI to 64MHz.
; if this number is wrong, there will be no output.
swo_trace_clkin_freq = 16000000
; if you want to see SWO outputs during debugging, a custom
; debug server invocation must be used.
; adapt interface and target accordingly.
; this entails changing the traceclk parameter to match
; the swo_trace_clkin_freq above.
; the SWO pin frequency param is irrelevant, since we are forwarding to
; tcl_trace, but OpenOCD will otherwise fail to enable the TPIU.
; this is used when starting debugging, not in the SWO Viewer task.
; after debugging starts, one must manually start the swo_viewer.py with
; python swo_parser.py --dont-run
debug_server = $PLATFORMIO_CORE_DIR/packages/tool-openocd/bin/openocd
-s $PLATFORMIO_CORE_DIR/packages/tool-openocd/openocd/scripts/
-f interface/stlink.cfg
-c "transport select hla_swd"
-f target/stm32f4x.cfg
-c "stm32f4x.tpiu configure -protocol uart"
-c "stm32f4x.tpiu configure -output -"
-c "stm32f4x.tpiu configure -traceclk 16000000"
-c "stm32f4x.tpiu configure -pin-freq 2000000"
-c "stm32f4x.tpiu configure -formatter 0"
-c "itm ports on"
-c "stm32f4x.tpiu enable"
-c "tcl_port 6666"