rust-embedded/discovery

OpenOCD configuration for F3Discovery changed in v0.12

casphas opened this issue · 0 comments

On Debian 12 with openocd package version 0.12.0-1 and gdb package version 13.1-3 installed, the example configuration for setting up iprintln! in openocd.gdb no longer works as well as it did with openocd v0.11:

https://github.com/rust-embedded/discovery/blob/d5c02481b30e384a6807ec6f85fb975b79edd1be/f3discovery/src/openocd.gdb#L18C1-L18C54

The line:
monitor tpiu config internal itm.txt uart off 8000000

results in deprecation warnings in openocd output on the first gdb run after starting openocd with openocd -f interface/stlink.cfg -f target/stm32f3x.cfg :

DEPRECATED 'tpiu config' command: Using stm32f3x.tpiu
DEPRECATED 'tpiu config' command: Running: 'stm32f3x.tpiu configure -protocol uart -traceclk 8000000 -output itm.txt -formatter off'
DEPRECATED 'tpiu config' command: Running: 'stm32f3x.tpiu enable'

Subsequent runs without restarting openocd result in an error:

Cannot configure TPIU/SWO; stm32f3x.tpiu is enabled!
../openocd.gdb:20: Error in sourced command file:
Protocol error with Rcmd

Apart from the changed configuration syntax for TPIU in openocd 0.12, the tpiu configuration seems to persist
and subsequent calls to configure the device fail, which they did not in openocd 0.11.

Changing the configuration in openocd.gdb to use the new style (copied from the deprecation warnings) and disabling the TPIU device before configuring it makes it work again regardless of whether openocd has been restarted or not:

monitor stm32f3x.tpiu disable
monitor stm32f3x.tpiu configure -protocol uart -traceclk 8000000 -output itm.txt -formatter off
monitor stm32f3x.tpiu enable