Raspberry Pi RP2040 Getting Started page 22

Table of Contents

Advertisement

Getting started with Raspberry Pi Pico
reset
exit
TIP
If you see an error like
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
then rebuild, and rerun the
int
main() {
 
const
 
gpio_init(LED_PIN);
 
gpio_set_dir(LED_PIN, GPIO_OUT);
 
while
 
 
 
 
 
 
}
}
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"
5.3. Loading a Program
Put the RP2040 into a clean initial state, as though it had just powered up, so
that it is ready to run our code.
Disconnect from the RP2040 and exit. Our freshly-programmed code will
start running once OpenOCD disconnects.
Info: DAP init failed
command above:
openocd
uint LED_PIN = 25;
(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);
then OpenOCD could not see an RP2040 on the SWD interface it used.
blink/blink.c
to flash the LED more quickly, and
21

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Pico

Table of Contents

Save PDF