Skip to content

Commit

Permalink
Fix TPIU initialization in platformio.ini to comply with the newer Op…
Browse files Browse the repository at this point in the history
…enOCD syntax
  • Loading branch information
cristianfrasineanu committed Mar 1, 2022
1 parent 051a811 commit c226fd4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ swo_trace_clkin_freq = 64000000
and

```py
-c "tpiu config internal - uart off 64000000"
-c "nucleo_f103rb.tpiu configure -traceclk 64000000"
```

clock values. This **must** be the HCLK frequency / CPU frequency that the microcontroller is setup to run with in the firmware.
Expand Down
12 changes: 11 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,22 @@ 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 config internal - uart off 64000000"
-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"

0 comments on commit c226fd4

Please sign in to comment.