Getting started with Raspberry Pi Pico
Ensuring your Raspberry Pi 4 and Raspberry Pi Pico are correctly wired together, we can attach OpenOCD to the chip, via
the
and
swd
rp2040
$ openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg
WARNING
If your flash has DORMANT mode code in it, or any code that stops the system clock, the debugger will fail to attach
because the system clock is stopped. While this may present as a "bricked" board you can return to BOOTSEL mode
using the button without problems.
This OpenOCD terminal needs to be left open. So go ahead and open another terminal, in this one we'll attach a gdb
instance to OpenOCD.
Navigate to your project, and start
$ cd ~/pico/test
$ gdb-multiarch test.elf
Connect GDB to OpenOCD,
(gdb) target remote localhost:3333
and load it into flash, and start it running.
(gdb) load
(gdb) monitor reset init
(gdb) continue
With both
openocd
$ python3 openocd_svd.py /home/pi/pico/pico-sdk/src/rp2040/hardware_regs/rp2040.svd
This will open the
the running
openocd
This will allow you to inspect the registers of the code running on your Raspberry Pi Pico, see
10.3. Other Environments
configs.
,
gdb
and
running, open a third window and start
gdb
window. Now go to the File menu and click on "Connect OpenOCD" to connect via telnet to
openocd-svd
instance.
pointing it to the SVD file in the SDK.
openocd-svd
Figure
34.
55
Need help?
Do you have a question about the RP2040 and is the answer not in the manual?