EasyManua.ls Logo

Raspberry Pi Pico Series - Load and Run Blink

Raspberry Pi Pico Series
54 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
-- Build files have been written to: /home/pi/pico/pico-examples/build
IMPORTANT
The SDK builds binaries for the Raspberry Pi Pico 2 by default. To build a binary for a different board, pass the
-DPICO_BOARD=<board> option to CMake, replacing the <board> placeholder with the name of the board you’d like to
target. To build a binary for Pico 2, pass -DPICO_BOARD=pico2. To build a binary for Pico W, pass -DPICO_BOARD=pico_w.
You can specify a Wi-Fi network and password that your Pico W examples should connect to, by passing
-DWIFI_SSID="Your Network" -DWIFI_PASSWORD="Your Password" too.
You can now type make to build all example applications. However, for this example we only need to build blink. To build
a specific subtree of examples, navigate into the corresponding subtree before running make. In this case, we can build
only the blink task by first navigating into the blink directory, then running make:
$ cd blink
$ make -j4
Scanning dependencies of target ELF2UF2Build
Scanning dependencies of target boot_stage2_original
[ 0%] Creating directories for 'ELF2UF2Build'
Ê .
Ê .
Ê .
[100%] Linking CXX executable blink.elf
[100%] Built target blink
TIP
Invoking make with -j4 speeds the build up by running four jobs in parallel. A Raspberry Pi 5 has four cores, so four
jobs spreads the build evenly across the entire SoC.
Amongst other targets, this builds:
blink.elf
used by the debugger
blink.uf2
the file we’ll copy onto the USB Mass Storage Device that represents your Raspberry Pi microcontroller
Load and run "Blink"
To load software onto a Raspberry Pi microcontroller-based board, mount it as a USB Mass Storage Device and copy a
uf2 file onto the board to program the flash.
Hold down the BOOTSEL button (Figure 13) while plugging in your device using a micro-USB cable to force it into USB
Mass Storage Mode.
The device will reboot, unmount itself as a Mass Storage Device, and run the flashed code, see Figure 13.
Getting started with Raspberry Pi Pico-series
Use the CLI to Blink an LED in C 36

Table of Contents

Related product manuals