Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenOCD configuration for F3Discovery changed in v0.12 #548

Open
casphas opened this issue Nov 8, 2023 · 0 comments
Open

OpenOCD configuration for F3Discovery changed in v0.12 #548

casphas opened this issue Nov 8, 2023 · 0 comments

Comments

@casphas
Copy link

casphas commented Nov 8, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant