KevsRobots Learning Platform
60% Percent Complete
By Kevin McAleer, 2 Minutes
Page last updated June 15, 2025
To program your Raspberry Pi Pico in C, you’ll need a toolchain — the set of software tools that compile your code and upload it to the board.
This lesson walks you through installing the official Pico SDK and CMake-based toolchain.
sudo apt update
sudo apt install cmake gcc-arm-none-eabi build-essential libnewlib-arm-none-eabi git
Install Homebrew, then:
brew tap ArmMbed/homebrew-formulae
brew install cmake gcc-arm-embedded
Use WSL with Ubuntu for best results. Inside WSL, use the Linux steps above.
mkdir -p ~/pico
cd ~/pico
git clone -b master https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
Now clone the example projects:
cd ~/pico
git clone -b master https://github.com/raspberrypi/pico-examples.git
Add the SDK path to your shell config:
echo "export PICO_SDK_PATH=~/pico/pico-sdk" >> ~/.bashrc
source ~/.bashrc
cd ~/pico/pico-examples/blink
mkdir build
cd build
cmake ..
make
You should now have a file called blink.uf2
— this is the binary you’ll upload to the Pico.
blink.uf2
file onto the driveYour Pico will reboot and start blinking the onboard LED!
You now have:
.uf2
firmware filesNext up: Your First Program in C, where you’ll write a custom C program from scratch and upload it to the Pico.
You can use the arrows ← →
on your keyboard to navigate between lessons.