There can be a number of reasons ITM tracing fails.
- The `openocd.gdb` script enables ITM tracing assuming the `/tmp/itm.log` and `itmdump` has been correctly setup before `gdb` is launched (and the script run). So the first thing is to check that you follow the sequence suggested above.
- The `openocd.gdb` script (or `launch.json` if in vscode using external ITM logging) enables ITM tracing assuming that the `/tmp/itm.fifo` and `itmdump` has been correctly setup before `gdb` is launched. So the first thing is to check that you follow the sequence suggested above.
-`openocd.gdb`sets enables ITM tracing by:
...
...
@@ -593,7 +593,7 @@ This invokes the `init` event, which sets the core clock to 64MHz. If you intend
monitor tpiu config internal /tmp/itm.fifo uart off 64000000 2000000
```
If you on the other hand want to use `monitor reset init` but not having the core clock set to 64MHz, you can use a custom `.cfg` (instead of the one shipped with `openocd`). The original `/usr/share/openocd/scripts/target/stm32f0x.cfg` looks like this:
If you on the other hand want to use `monitor reset init` but not having the core clock set to 64MHz, you can use a custom `.cfg` (instead of the one shipped with `openocd`). The original `/usr/share/openocd/scripts/target/stm32f4x.cfg` looks like this:
``` txt
...
...
...
@@ -808,6 +808,16 @@ We see some similarities to the `openocd.gdb` file, we don't need to explicitly
---
### Rust-Analyzer
In order to properly track symbols from the `core` and/or `std` libraries, you need to add the Rust source. This can be done by:
``` shell
> rustup component add rust-src
````
---
## GDB Advanced Usage
There are numerous ways to automate `gdb`. Scripts can be run by the `gdb` command `source` (`so` for short). Scripting common tasks like setting breakpoints, dumping some memory region etc. can be really helpful.