-
Notifications
You must be signed in to change notification settings - Fork 33
Setting Up the Pico SDK on Linux for Pico Development
This guide walks you through setting up the Raspberry Pi Pico SDK on a Linux system for PicoCalc development. By the end, you'll have a working environment to compile and flash firmware to your Raspberry Pi Pico on PicoCalc.
Before getting started, make sure you have the following:
- A Linux system (Ubuntu, Debian, etc.)
- Raspberry Pi Pico
- USB cable for flashing firmware
- USB Type-C cable for running
- Basic familiarity with the terminal
Open a terminal and install the necessary tools:
sudo apt update && sudo apt install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential git
Navigate to a workspace directory and clone the official Raspberry Pi Pico SDK:
mkdir -p ~/pico && cd ~/pico
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git checkout tags/2.0.0 -b sdk2.0.0
git submodule update --init
To ensure the build system finds the SDK, set an environment variable:
echo 'export PICO_SDK_PATH=~/pico/pico-sdk' >> ~/.bashrc
source ~/.bashrc
For Zsh users:
echo 'export PICO_SDK_PATH=~/pico/pico-sdk' >> ~/.zshrc
source ~/.zshrc
Let's create a sample project using the Pico SDK:
cd ~/pico
git clone https://github.com/raspberrypi/pico-examples.git
mkdir -p pico-examples/build && cd pico-examples/build
Now, configure the project with CMake:
cmake ..
Compile a sample program (e.g., Blink):
make -j$(nproc) blink
If successful, this will generate a blink.uf2
file inside build/blink/
.
To flash the firmware to your Pico:
-
Hold down the BOOTSEL button on the Pico.
-
Plug it into your computer via USB then release BOOTSEL.
-
The Pico should appear as a mass storage device (
RPI-RP2
). -
Copy the
blink.uf2
file to the Pico:cp blink/blink.uf2 /media/$USER/RPI-RP2/
The Pico will automatically reboot and start running the Blink program.
To check if your Pico is working correctly, unplug micro-usb, plug PicoCalc to your computer via USB Type-C ,and press Power On
Note: On PicoCalc, the default serial port of the Pico is the USB Type-C port, not its built-in Micro USB port.
you can use minicom
or screen
to monitor serial output:
sudo apt install -y minicom
minicom -b 115200 -o -D /dev/ttyACM0
Press Ctrl+A, then Z, and select Quit when finished.
You now have the Raspberry Pi Pico SDK set up on Linux and successfully flashed firmware onto your Pico. You can start developing and customizing firmware for PicoCalc projects!
For more details, refer to the official Pico SDK documentation.