raspberrypi / pico-vscode

The official VS Code extension for Raspberry Pi Pico development. It includes several features to simplify project creation and deployment.
https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico
Mozilla Public License 2.0
131 stars 16 forks source link

Raspberry Pi Pico Visual Studio Code extension

Note: The extension is currently under development.

This is the official Visual Studio Code extension for Raspberry Pi Pico development. This extension equips you with a suite of tools designed to streamline your Pico projects using Visual Studio Code and the official Pico SDK.

For comprehensive setup instructions, refer to the Getting Started guide PDF.

Download latest Beta 📀

Features

Project Setup and Management

Configuration and Tool Management

Build, Debug, and Documentation

Requirements by OS

Supported Platforms: Raspberry Pi OS (64-bit), Windows 10/11 (x86_64), macOS Sonoma (14.0) and newer, Linux x64 and arm64

Raspberry Pi OS and Windows

No additional requirements are needed.

macOS

To meet the requirements for macOS, run the following command in Terminal to install necessary tools:

xcode-select --install

This command installs all of the necessary tools, including but not limited to:

Linux

Extension Settings

This extension provides the following settings:

CMake Tools Extension Integration

For more complex projects, such as those with multiple executables or when the project name is defined as a variable, this extension can integrate with the CMake Tools extension to enhance CMake parsing. You can enable CMake Tools integration during project generation under the Advanced Options. Additionally, to manually enable it, adjust the following settings in your settings.json:

For optimal functionality, consider enabling:

When prompted, select the Pico kit in CMake Tools, and set your build and launch targets accordingly. Use CMake Tools for compilation, but continue using this extension for debugging, as CMake Tools debugging is not compatible with Pico.

VS Code Profiles

If you work with multiple microcontroller toolchains, consider installing this extension into a VS Code Profile to avoid conflicts with other toolchains. Follow these steps:

  1. Download the sample profile from here.
  2. Open Command Palette with Ctrl+Shift+P (or Cmd+Shift+P on macOS) and select Profiles: Import Profile.
  3. Import the downloaded file to install the extension in a dedicated Pico profile.
  4. This setup helps isolate the Pico extension from other extensions, reducing the risk of conflicts.

Known Issues

GitHub API Rate Limit ("Error while retrieving SDK and toolchain versions")

If you encounter issues retrieving available Pico SDK versions, it may be due to GitHub API rate limits. To resolve this, create a personal access token (classic PAT) with the public_repo scope and set it in the global (User) extension settings to increase your rate limit.

Build Instructions

For advanced users who want to build the extension .vsix file, follow these steps:

  1. Install nodejs (Instructions Windows)
  2. Install Yarn globally: npm install -g yarn
  3. Install VSCE globally: npm install -g @vscode/vsce
  4. Run yarn in the project directory to install dependencies.
  5. Build the extension with: vsce package.

This will generate a .vsix file, which you can install in VS Code using code --install-extension path-to.vsix or via the GUI: Extensions > three dots > Install from VSIX.