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 #22 background imageLoading...
Page #22 background image
reset
Put the RP2040 into a clean initial state, as though it had just powered up, so
that it is ready to run our code.
exit
Disconnect from the RP2040 and exit. Our freshly-programmed code will
start running once OpenOCD disconnects.
TIP
If you see an error like Info: DAP init failed then OpenOCD could not see an RP2040 on the SWD interface it used.
The most common reasons are that your board is not correctly powered via e.g. a USB cable; that the SWD wiring is
not correct (e.g. the ground wire is not connected, or SWDIO and SWCLK have been swapped); or that there is some
signal integrity issue caused by long or loose jumper wires.
To check that you really have loaded a new program, you can modify blink/blink.c to flash the LED more quickly, and
then rebuild, and rerun the
openocd command above:
int main() {
Ê
const uint LED_PIN = 25;
Ê gpio_init(LED_PIN);
Ê gpio_set_dir(LED_PIN, GPIO_OUT);
Ê
while (true) {
Ê gpio_put(LED_PIN,
1);
Ê
// Blink faster! (this is the only line that's modified)
Ê sleep_ms(25);
Ê gpio_put(LED_PIN,
0);
Ê sleep_ms(
250);
Ê }
}
And then,
$ cd pico-examples/build
$ make blink
$ # (the application is rebuilt)
$ openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg -c "program blink/blink.elf
verify reset exit"
Getting started with Raspberry Pi Pico
5.3. Loading a Program 21

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