IMPORTANT
If you see errors similar to Error finishing flash operation or Error erasing flash with vFlashErase packet in GDB when
attempting to load the binary onto the Raspberry Pi Pico via OpenOCD then there is likely poor signal integrity
between the Raspberry Pi and the Raspberry Pi Pico. If you are not directly connecting the SWD connection between
the two boards, see
Figure 7, you should try to do that. Alternatively you can try reducing the value of adapter_khz in
the
raspberrypi-swd.cfg configuration file, trying halving it until you see a successful connection between the boards.
As we’re bitbanging between the boards timing is marginal, so poor signal integrity may cause errors.
Or if you want to set a breakpoint at main() before running the executable,
(gdb) monitor reset init
(gdb) b main
(gdb) continue
Thread 1 hit Breakpoint 1, main () at /home/pi/pico/pico-
examples/hello_world/serial/hello_serial.c:11
11 stdio_init_all();
before continuing after you have hit the breakpoint,
(gdb) continue
To quit from
gdb type,
(gdb) quit
More information about how to use
gdb can be found at https://www.gnu.org/software/gdb/documentation/.
Getting started with Raspberry Pi Pico
6.3. Use GDB and OpenOCD to debug Hello World 24