discovery
discovery copied to clipboard
Missing note on using the right GDB executable depending on your distro
On this page for the LED roulette challenge (https://rust-embedded.github.io/discovery/05-led-roulette/the-challenge.html) I had troubles when following the last tip to use the cargo run command i.c.w. openocd.gdb and .cargo/config
Running the following command I got an error No such file or directory (os error 2)
$ cargo run --target thumbv7em-none-eabihf
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `arm-none-eabi-gdb -q -x openocd.gdb /home/user/workspace/rust/discovery/target/thumbv7em-none-eabihf/debug/led-roulette`
error: could not execute process `arm-none-eabi-gdb -q -x openocd.gdb /home/user/workspace/rust/discovery/target/thumbv7em-none-eabihf/debug/led-roulette` (never executed)
Caused by:
No such file or directory (os error 2)
arm-none-eabi-gdb
It took me a while to find out that I should use gdb-multiarch instead of arm-none-eabi-gdb (because I'm using Debian) in the config file:
[target.thumbv7em-none-eabihf]
runner = "gdb-multiarch -q -x openocd.gdb" # <-
rustflags = [
"-C", "link-arg=-Tlink.x",
]
For newcomers to GDB (like me) it would be nice to have a reminder in the form of a note that tells about the different executables for the GDB software depending on your distro.