GDB + OpenOCD issues
I am trying to debug my assembly program for the pi pico using a debug probe. Here are the commands that I use:
To restart:
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:
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
Flashing using OpenOCD like it's shown in the Debug Probe Documentation
doesn't work for me and produces this error message:
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"Code: Select all
(gdb) monitor reset halt
(gdb) loadCode: 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`
....I flash the program either with the standart uf2 method or with
Code: Select all
(gdb) file ./program.elfCode: Select all
sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c "program blink.elf verify reset exit"Code: Select all
** Programming Started **
Error: Unknown flash device (ID 0x00154068)
Error: auto_probe failed
** Programming Failed **
shutdown command invoked
Re: GDB + OpenOCD issues
With that arm-none-eabi-gdb, are you running on a macOS or Windows device?
Response to @neilgl
Sorry for the long response time, I was busy yesterday.
I am using Linux.
I am using Linux.
Re: GDB + OpenOCD issues
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.
set architecture arm
My setup is the same. Debugging an RP2040 Pico, using an RPI debug probe, on a RPI 5.
Return to "Bare metal, Assembly language"
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion