We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

4 posts • Page 1 of 1
virus.exe
Posts: 8
Joined: Sat May 17, 2025 12:28 pm

GDB + OpenOCD issues

Mon Jul 07, 2025 2:52 pm

I am trying to debug my assembly program for the pi pico using a debug probe. Here are the commands that I use:

Code: Select all

openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000; gdb_memory_map disable"

Code: Select all

arm-none-eabi-gdb ./program.elf -ex "target extended-remote :3333"
To restart:

Code: Select all

(gdb) monitor reset halt
(gdb) load
Everything looks fine, but gdb can't place breakpoints, not with `break ...` nor with `monitor bp ...`. I assume as I side effect of that - if I use `next`/`nexti` on a "branch with link (bl/blx)" instruction gdb doesn't halt on the next instructions. For some reason passing a label gdb also continues. Example:

Code: Select all

	mov r1, #0
	str r1, [r0, #0] <-- `(gdb) nexti`
label:
	ldr r0, =address <-- gdb doesn't stop here, just as if I used `continue`
	....
In both of those cases pressing Ctrl-C will show the processor in a loop later in the program.
I flash the program either with the standart uf2 method or with

Code: Select all

(gdb) file ./program.elf
Flashing using OpenOCD like it's shown in the Debug Probe Documentation

Code: Select all

sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c "program blink.elf verify reset exit"
doesn't work for me and produces this error message:

Code: Select all

** Programming Started **
Error: Unknown flash device (ID 0x00154068)
Error: auto_probe failed
** Programming Failed **
shutdown command invoked

neilgl
Posts: 11309
Joined: Sun Jan 26, 2014 8:36 pm

Re: GDB + OpenOCD issues

Tue Jul 08, 2025 8:13 pm

With that arm-none-eabi-gdb, are you running on a macOS or Windows device?

virus.exe
Posts: 8
Joined: Sat May 17, 2025 12:28 pm

Response to @neilgl

Wed Jul 09, 2025 5:51 am

Sorry for the long response time, I was busy yesterday.
I am using Linux.

coffeecup
Posts: 3
Joined: Sun May 04, 2025 8:05 pm

Re: GDB + OpenOCD issues

Wed Aug 13, 2025 5:20 am

I don’t remember why exactly, but if you are not using it, I needed to switch to using gdb-multiarch. And when I start gdb-multiarch I send this command to let it know I’m debugging an arm chip:

set architecture arm

My setup is the same. Debugging an RP2040 Pico, using an RPI debug probe, on a RPI 5.

4 posts • Page 1 of 1

Return to "Bare metal, Assembly language"

AltStyle によって変換されたページ (->オリジナル) /