By Nobody 2026-09-15
Introduction
The Raspberry Pi Pico is a nice MCU chip and board for quick projects.
See also Raspberry Pi for more information.
IDEs
- use Visual Studio Code for editor
- use Arduino V2 for quick hacks with existing code for external devices
- the Raspberry Pi Pico SDK with cmake, nija best for low-level development
Arduino V2
Use the boards manager to install “Raspberry Pi Pico/RP2040/RP2350” by Earle F. Philhower, III.
Pico SDK Installation on Windows 11.
Create a Python venv
Use cmd.exe.
mkdir c:\pico
cd c:\pico
python -m venv .venv
REM or, using uv: uv venv --python 3.14.7 .venv
.\venv\Scripts\activate.bat
Install Prerequisites
winget install -e --id Arm.GnuArmEmbeddedToolchain
winget install -e --id Kitware.CMake
winget install -e --id Ninja-build.Ninja
Clone the SDK
cd c:\pico
git clone -b master https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
Picotool
This is needed by the SDK to create .uf2 files and provides some command line options to work with the pico devices.
There were some issues where a board in BOOTSEL mode might not communicate at all with some versions of picotool.
This requires Visual Studio “desktop development with C++” installed.
Start a “x64 Native Tools for Command Prompt” terminal provided by VS.
While vcpkg can use a plain cmd.exe session, the developer terminal is used because it is needed later on when building picotool.
Microsoft vcpkg
Get vcpkg which is used to obtain and build things like libusb.
cd c:\wrk
mkdir tools
cd tools
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
Install libusb using vcpkg
cd c:\wrk\tools
.\vcpkg\vcpkg.exe install libusb
Clone and build picotool
cd c:\pico
git clone https://github.com/raspberrypi/picotool.git
cd picotool
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=release -DLIBUSB_INCLUDE_DIR=C:\wrk\tools\vcpkg\installed\x64-windows\include\libusb-1.0 -DLIBUSB_LIBRARIES=C:\wrk\tools\vcpkg\installed\x64-windows\lib\libusb-1.0.lib
cmake --build build
mkdir c:\pico\bin
cmake --install build --prefix c:\pico\bin
copy build\libusb-1.0.dll c:\pico\bin
Depending on results, might have to:
copy C:\wrk\tools\vcpkg\installed\x64-windows\bin\libusb-1.0.dll C:\pico\bin\
Path and Variables
This can be done using a batch file or user environment system settings.
Example batch file to bring in the pico toolchain.
set PICO_SDK=C:\pico\pico-sdk
set PATH=%PATH%;c:\pico\bin
Pico Examples
This will download and build an example.
cd c:\pico
git clone https://github.com/raspberrypi/pico-examples.git
cd c:\pico\pico-examples
cmake -S . -B build -G Ninja -DPICO_BOARD=pico
cmake --build build --target blink
Plug in the device, copy the .uf2 and it will run.
copy build\blink.uf2 D:
Simple Project
Make a project outside the pico-examples with custom CMakeLists.txt.
cd c:\pico
mkdir projects
cd projects
mkdir myblink
cd myblink
copy c:\pico\pico-examples\blink\blink.c .
copy c:\pico\pico-sdk\external\pico_sdk_import.cmake .
Create a CMakeLists.txt file:
cmake_minimum_required(VERSION 3.13)
include(pico_sdk_import.cmake)
project(myblink C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# init the pi pico sdk
pico_sdk_init()
add_executable(myblink
blink.c
)
# pull in common dependencies
target_link_libraries(myblink pico_stdlib)
if (PICO_CYW42_SUPPORTED)
target_link_libraries(myblink pico_cyw43_arch_none)
endif()
# create map/bin/hex files
pico_add_extra_outputs(myblink)
Now build it:
cd c:\pico\projects\myblink
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=debug -DPICO_BOARD=pico
cmake --build build