EasyManuals Logo

Raspberry Pi RP2040 User Manual

Raspberry Pi RP2040
77 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #24 background imageLoading...
Page #24 background image
$ openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg
Your output should look like this:
...
Info : rp2040.core0: hardware has 4 breakpoints, 2 watchpoints
Info : rp2040.core1: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections
WARNING
If you see an error like Info : DAP init failed then your Raspberry Pi Pico is either powered off, wired incorrectly, or
has signal integrity issues. Try different GPIO jumper cables.
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 the "Hello World" example code, and start
gdb from the command line.
$ cd ~/pico/pico-examples/build/hello_world/serial
$ gdb-multiarch hello_serial.elf
Connect GDB to OpenOCD,
(gdb) target remote localhost:3333
TIP
You can create a .gdbinit file so you don’t have to type target remote localhost:3333 every time. Do this with echo
"target remote localhost:3333" > ~/.gdbinit
. However, this interferes with debugging in VSCode (Chapter 7).
and load hello_serial.elf into flash,
(gdb) load
Loading section .boot2, size 0x100 lma 0x10000000
Loading section .text, size 0x22d0 lma 0x10000100
Loading section .rodata, size 0x4a0 lma 0x100023d0
Loading section .ARM.exidx, size 0x8 lma 0x10002870
Loading section .data, size 0xb94 lma 0x10002878
Start address 0x10000104, load size 13324
Transfer rate: 31 KB/sec, 2664 bytes/write.
and then start it running.
(gdb) monitor reset init
(gdb) continue
Getting started with Raspberry Pi Pico
6.3. Use GDB and OpenOCD to debug Hello World 23

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Raspberry Pi RP2040 and is the answer not in the manual?

Raspberry Pi RP2040 Specifications

General IconGeneral
ProcessorDual-core Arm Cortex-M0+
Clock Speed133 MHz
SRAM264 KB
GPIO30
USBUSB 1.1 Host/Device
PWM16 channels
UART2
SPI2
I2C2
Temperature Range-20°C to +85°C
Operating Voltage1.8V to 3.3V
FlashExternal QSPI flash
I/O InterfacesSPI, I2C, UART, PWM
ADC4 × 12-bit ADC channels

Related product manuals