Datasheet

Table Of Contents
Ensuring your Raspberry Pi 4 and Raspberry Pi Pico are correctly wired together, we can attach OpenOCD to the chip, via
the swd and rp2040 configs.
$ 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 gdb,
$ 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 and gdb running, open a third window and start openocd-svd pointing it to the SVD file in the SDK.
$ python3 openocd_svd.py /home/pi/pico/pico-sdk/src/rp2040/hardware_regs/rp2040.svd
This will open the openocd-svd window. Now go to the File menu and click on "Connect OpenOCD" to connect via telnet to
the running openocd instance.
This will allow you to inspect the registers of the code running on your Raspberry Pi Pico, see Figure 34.
Getting started with Raspberry Pi Pico
10.3. Other Environments 55