Using Gdb/OpenOCD and setting breakpoints

I'm playing with the RP2040 and Rust, building a hardware project for controlling a magnetic loop antenna tuning. I'm using RTIC and I'm having some success bringing the tools and workflow together to and to learn what I need.

I have come to the conclusion that a hardware debugger is essential when working with rust and RTIC on embedded hardware. My final hardware will be on the Adafruit RP2040 feather board with other feather wings for motor control, display, networking, etc. While waiting for the mini SWD connectors for the RP2040 Feather to arrive, I have setup two Picos. One as a Picoprobe, the other is the target board. I'm using the Pico specific build of OpenOCD with gdb-multiarch. I have confirmed I am building with debug info and that gdb is seeing it. Although, I don't see any local or global variables.

I'm running into problems setting breakpoints in any RTIC functions (tasks, init, etc.) in my code. I cannot resolve the name to set the breakpoint, and when I set the breakpoint in VSCode by clicking on a line, it says the line I pick for the breakpoint does not exist. Is there a trick to solving this?

I have resorted to inserting unsafe { core::arch::asm!("bkpt"); } in the source code to force a breakpoint. It is the only way I have been able to set a breakpoint in tasks to verify they are getting ran.

I also don't see any defmt messages, though I have semihosting enabled in the code and in gdb. I do see messages in the output from gdb saying that semihosting is active and being triggered, just no output. Do I need to set a minimum debug level for info!() and debug!() messages to show?

Any insights, comments, or even rude gestures that get me on the right path would be appreciated.

-Freeman (n5fpp)

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.