Raspberry Pi Pico

Setup and run first program

Raspberry Pi logo

This article talkes about Raspberry Pi Pico and shows how to build and run the first program (Blink LED).

Raspberry Pi Pico is a tiny, fast, and versatile board built using RP2040, a brand new microcontroller chip designed by Raspberry Pi

RP2040 features a dual-core Arm Cortex-M0+ processor with 264KB internal RAM and support for up to 16MB of off-chip Flash. A wide range of flexible I/O options includes I2C, SPI, and — uniquely — Programmable I/O (PIO).

From controlling appliances to operating a light display Pico can be used for any application.

Raspberry Pi Pico

Pin connection

Raspberry Pi Pico

Deploy sample code Blink LED

Clone the pico-sdk and pico-examples git repositories.
$ git clone -b master https://github.com/raspberrypi/pico-sdk.git
$ cd pico-sdk
$ git submodule update --init
$ cd ..
$ git clone -b master https://github.com/raspberrypi/pico-examples.git

Building "Blink"

From the pico directory we created earlier, cd into pico-examples and create a build directory. Then, assuming you cloned the pico-sdk and pico-examples repositories into the same directory side-by-side, set the PICO_SDK_PATH:
$ export PICO_SDK_PATH=../../pico-sdk
Prepare your cmake build directory by running cmake ..
CMake has now prepared a build area for the pico-examples tree. From here, it is possible to type make to build all example applications. However, as we are building blink we will only build that application for now by changing directory into the blink directory before typing make.
$ cd blink
$ make -j4

blink.uf2, which can be dragged onto the RP2040 USB Mass Storage Device

Load and run "Blink"

The simplest method to load software onto a RP2040-based board is by mounting it as a USB Mass Storage Device. Doing this allows you to drag a file onto the board to program the flash. Go ahead and connect the Raspberry Pi Pico to your Raspberry Pi using a micro-USB cable.

Drag and drop blink.uf2 onto the RP2040 USB Mass Storage Device. you can see the Pico start blinking

Find more detailed instruction on the Youtube video