NOTE: The extension is still under development.
This is the official Visual Studio Code extension for Raspberry Pi Pico development. It provides a set of tools to help you get started with development for the Pico boards using Visual Studio Code and the official Pico SDK.
This extension is documented in the Getting started with Raspberry Pi Pico PDF
- Project generator (targets ninja build-system)
- Automatic CMake configuration on project load
- Easy option to switch between different versions of the Pico-SDK and tools
- No configuration of environment variables required
- Automatic download/management of Toolchain and SDK and some tools (no separate manual download/installation required)
- One-click project compilation per status bar button (with the selected Pico-SDK and tools)
- Offline documentation for the Pico-SDK
Supported Platforms: Windows x64, macOS (Sonoma and newer only), Linux x64 and arm64
- Visual Studio Code v1.87.0 or later
All requirements for macOS can be installed by running xcode-select --install
from Terminal
- Git (in PATH)
- Tar (in PATH)
- Native C/C++ compiler (in PATH), supported compilers are:
gcc
andclang
As of March 2024, all new Raspberry Pi OS images come with the requirements pre-installed.
On older images the requirements can be installed by running sudo apt install openocd ninja-build
- Python 3.9 or later (in PATH or set in settings)
- Git (in PATH)
- Tar (in PATH)
- Native C/C++ compiler (in PATH), supported compilers are:
gcc
andclang
- [Optional] OpenOCD for debugging (Raspberry Pi OS only)
- [Optional] gdb-multiarch for debugging (x86_64 only)
This extension contributes the following settings:
raspberry-pi-pico.cmakePath
: Set custom cmake pathraspberry-pi-pico.python3Path
: Set custom python3 pathraspberry-pi-pico.ninjaPath
: Set custom ninja pathraspberry-pi-pico.gitPath
: Set custom git pathraspberry-pi-pico.cmakeAutoConfigure
: Enable/Disable cmake auto configure on project loadraspberry-pi-pico.githubToken
: Takes a GitHub personal access token (classic) with thepublic_repo
scope. It is used to check GitHub for available versions of the Pico SDK and other tools. Without one, the extension will use the GitHub API unauthenticated, which has a much lower rate limit causing many features to not work properly if the limit is reached. The unauthenticated rate limit is per public IP address, so this is more likely to be necessary if you share your IP address with many other users.
- Custom Ninja, Python3 and git paths are not stored in
CMakeLists.txt
like the SDK and Toolchain paths, so using them requires the user to build and configure the project through the extension
If the extension fails to get available Pico SDK versions, it might be because of the GitHub API rate limit. You can create a personal access token (classic) with the public_repo
scope and set it in the global ("User" not "Workspace") extension settings to increase the rate limit.
For advanced users who want to build the .vsix file for the extension, these instructions might work for you.
- Install npm (see here for Windows instructions)
- Install yarn
npm install --global yarn
- Install vsce
npm install --global @vscode/vsce
- Run
yarn
from the project directory - Run
vsce package
from the project directory
This will produce a .vsix file which can then be installed in VS Code with code --install-extension path-to.vsix
or in the GUI Extensions > three dots > install vsix
.