Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6980

Bare metal, Assembly language • GDB + OpenOCD issues

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

Code:

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

Code:

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

Code:

(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:

mov r1, #0str 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:

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

Code:

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:

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

Statistics: Posted by virus.exe — Mon Jul 07, 2025 2:52 pm — Replies 0 — Views 28



Viewing all articles
Browse latest Browse all 6980

Trending Articles