rust-embedded / discovery

Discover the world of microcontrollers through Rust!
https://docs.rust-embedded.org/discovery/
Apache License 2.0
1.49k stars 515 forks source link

gdb continues forever #477

Open oslfmt opened 2 years ago

oslfmt commented 2 years ago

I'm working through 05-led-roulette and I am at the "debug it" step. I connected to the remote GDB server and set a breakpoint at main. However, when I type "continue" to run the program up till main, gdb just continues and never stops. I am stuck at this point and the only way I can exit is ctrl+c. Here's my output of the commands I've run so far:

(gdb) target remote :1337
Remote debugging using :1337
warning: while parsing target description (at line 4): Target description specified unknown architecture "armv7e-m"
warning: Could not load XML target description; ignoring
<nrf52833_pac::ppi::tasks_chg::dis::DIS_AW as core::fmt::Debug>::fmt (
    self=0x177 <DefaultHandler_>, f=0x3f7 <HardFaultTrampoline>)
    at /home/victor/.cargo/registry/src/github.com-1ecc6299db9ec823/nrf52833-pac-0.10.1/src/lib.rs:2121
2121        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
(gdb) break main
Breakpoint 1 at 0x164: file src/05-led-roulette/src/main.rs, line 9.
(gdb) continue
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.

I am on microbit:v2 and I'm pretty sure I've set up everything right. This issue was also encountered here: https://github.com/rust-embedded/book/issues/192

However, I'm not sure what the memory.x file is supposed to do, the book makes no mention of it up till this point. I have a feeling the "unknown architecture" in the output above, after connecting to remote target :1337 is something to do with the issue but not sure.

margaretdax commented 1 year ago

Sounds like from rust-embedded/book#192 this can be closed as well @victor-wei126?