Chapter 7. Using Visual Studio Code
Visual Studio Code (VSCode) is a popular open source editor developed by Microsoft. It is the recommended Integrated
Development Environment (IDE) on the Raspberry Pi 4 if you want a graphical interface to edit and debug your code.
7.1. Installing Visual Studio Code
IMPORTANT
These installation instructions rely on you already having downloaded and installed the command line toolchain (see
Chapter 3), as well as connecting SWD to your board via OpenOCD (Chapter 5) and setting up GDB for command-line
debugging (
Chapter 6).
ARM versions of Visual Studio Code for the Raspberry Pi can be downloaded from https://code.visualstudio.com/
Download
. If you are using a 32-bit operating system (e.g. the default Raspberry Pi OS) then download the ARM .deb file; if
you are using a 64-bit OS, then download the
ARM 64 .deb file. Once downloaded, double click on the .deb package and
follow the instructions to install it.
Install the downloaded
.deb. package from the command line. cd to the folder where the file was downloaded, then use
dpkg -i <downloaded file name.deb> to install.
Once the install has completed, install the extensions needed to debug a Raspberry Pi Pico:
code --install-extension marus25.cortex-debug
code --install-extension ms-vscode.cmake-tools
code --install-extension ms-vscode.cpptools
Finally, start Visual Studio Code from a Terminal window:
$ export PICO_SDK_PATH=/home/pi/pico/pico-sdk
$ code
Ensure you set the
PICO_SDK_PATH so that Visual Studio Code can find the SDK.
NOTE
If PICO_SDK_PATH is not set by default in your shell’s environment you will have to set it each time you open a new
Terminal window before starting vscode, or start vscode from the menus. You may therefore want to add it to your
.profile or .bashrc file.
NOTE
You can configure intellisense for CMake by changing the provider by toggling; View → Command Palette → C/C++:
Change Configuration Provider… → CMake Tools.
Getting started with Raspberry Pi Pico
7.1. Installing Visual Studio Code 25