Pi Pico VSCodium on Linux Mint setup script.
Took me ages to get the Raspberry Pi Pico VSCode environment sort of set up on Linux Mint but I could never quite replicate the results on every machine I use (there are a few) and it was hit and miss with debugging etc.
I'd spend a lot more time fighting the development environment than actually coding and by the time I'd got it working I'd lost the will to code.
I was over it, I'd consigned the Pi Pico boards back into the box and reverted to my favourite STM32 chips.
Recently ST announced they're starting to use VSCode and nightmares that I might get stuck in the same loop began to grow in my mind.
I decided that I needed to spend a little time working out how to install a complete, working IDE for the Pi Pico, figuring it would open up an alternative to STM as well as giving me a way to use the Pi Pico boards I'd bought in an integrate development environment instead of with a bunch of command shell alphabetti spaghetti
So, I did a little reading, realised it was a bunch of boring repetition and outsourced it to an AI.
The AI failed, quite badly, but it did give me enough hints that I managed to create a script from its' base which works.
Of course, YMMV, it may not work on your machine and obviously use at your own risk, but right now, 14th September, 2026 at 7PM and on a fresh Mint install, the script in this post works.
It will install and configure all the pre-requisites (that I'm aware of) necessary for you to develop C, C++, Python, Rust and even Zephyr, in VSCodium (a non creepy, no tracking version of VSCode).
It sets up GDB for debugging, using a Picoprobe or Segger J-Link and thus far I've not run into any problems.
The environment I'm using:
Mint Linux 22.3 Cinnamon
Core i7 11th Gen
32GB RAM
To use the script, you need to save it to your machine and call it something sensible wqith a .sh extension, I use Pico-setup.sh
Once you've got the script saved, you need to make t executable, from a shell prompt:
chmod +x Pico-setup.sh
Then execute the script:
bash ./Pico-setup.sh
It will ask for your password and then pootle off to download, install and configure everything I need for a Pico dev environment.
If it encounters an error at any point it will exit at that step and the error will be displayed.
The script (at your own risk, I do not warrant or support this, it may eat your cat, it may send your banking credentials to North Korean dictators to buy WMD or pizza):
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status
set -e
echo "========================================================"
echo " Starting Raspberry Pi Pico Setup for Linux Mint"
echo "========================================================"
# 1. Update system and install required system tools & toolchain
echo "--> Installing compiler dependencies and system utilities..."
sudo apt update
sudo apt install -y \
cmake \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi \
build-essential \
git \
gdb-multiarch \
binutils-multiarch \
libusb-1.0-0-dev \
libhidapi-hidraw0 \
pkg-config \
curl \
gnupg
# Create symlinks for debug
cd /usr/bin
sudo ln -s /usr/bin/objdump objdump-multiarch
sudo ln -s /usr/bin/nm nm-multiarch
cd ~/
# 2. Create Directories and Setup Pico SDK
PICO_DIR="$HOME/pico"
echo "--> Creating workspace directory at $PICO_DIR..."
mkdir -p "$PICO_DIR"
cd "$PICO_DIR"
if [ ! -d "pico-sdk" ]; then
echo "--> Cloning Pico SDK..."
git clone --recurse-submodules https://github.com/raspberrypi/pico-sdk
else
echo "Pico SDK directory already exists. Skipping clone."
fi
if [ ! -d "pico-examples" ]; then
echo "--> Cloning Pico Examples..."
git clone --recurse-submodules https://github.com/raspberrypi/pico-examples
else
echo "Pico Examples directory already exists. Skipping clone."
fi
if [ ! -d "pico-playground" ]; then
echo "--> Cloning Pico Playground..."
git clone --recurse-submodules https://github.com/raspberrypi/pico-playground
else
echo "Pico SDK directory already exists. Skipping clone."
fi
if [ ! -d "pico-extras" ]; then
echo "--> Cloning Pico Extras..."
git clone --recurse-submodules https://github.com/raspberrypi/pico-extras
else
echo "Pico extras directory already exists. Skipping clone."
fi
if [ ! -d "picotool" ]; then
echo "--> Cloning PicoTool..."
git clone --recurse-submodules https://github.com/raspberrypi/picotool
else
echo "Pico SDK directory already exists. Skipping clone."
fi
# 3. Build and Install Picotool
if [ ! -d "picotool" ]; then
echo "--> Cloning and building picotool..."
git clone https://github.com
cd picotool
mkdir -p build && cd build
cmake ..
make -j$(nproc)
sudo make install
cd "$PICO_DIR"
fi
# 4. Configure Environment Variables (.bashrc)
echo "--> Setting up environment variables..."
if ! grep -q "PICO_SDK_PATH" "$HOME/.bashrc"; then
echo "export PICO_SDK_PATH=~/pico/pico-sdk" >> "$HOME/.bashrc"
echo "Environment variables added to ~/.bashrc"
source $HOME/.bashrc
else
echo "PICO_SDK_PATH already defined in ~/.bashrc"
source $HOME/.bashrc
fi
# 5. Set Up Hardware Udev Rules for Debugging & Flashing
echo "--> Writing hardware rules for Pico and Segger J-Link..."
# Pico bootloader rules and debugging probes
sudo bash -c 'cat << EOF > /etc/udev/rules.d/99-pico.rules
# Raspberry Pi Pico Bootloader mode (BOOTSEL)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0003", MODE:="0666"
# Raspberry Pi Pico USB Serial / CDC
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000a", MODE:="0666"
# Pico Debug Probe / CMSIS-DAP
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", MODE:="0666", GROUP="plugdev"
EOF'
# Segger J-Link debugger hardware rules
sudo bash -c 'cat << EOF > /etc/udev/rules.d/99-jlink.rules
# SEGGER J-Link Emulator
ATTR{idVendor}=="1357", MODE="0666", GROUP="plugdev"
EOF'
# Reload rules without requiring immediate reboot
echo "--> Reloading subsystem rules..."
sudo udevadm control --reload-rules
sudo udevadm trigger
###########################################################################################################
# 8. Install Segger J-Link
#echo "--> Downloading and installing Segger J-Link..."
#if [ ! -d "/opt/SEGGER/JLink" ]; then
# TEMP_DEB="$(mktemp).deb"
# curl -d "accept_license_agreement=accepted" -X POST https://segger.com -o "$TEMP_DEB"
# sudo apt install -y "$TEMP_DEB"
# rm -f "$TEMP_DEB"
#else
# echo "Segger J-Link is already installed in /opt/SEGGER."
#fi
# Reload rules without requiring immediate reboot
#echo "--> Reloading subsystem rules..."
#sudo udevadm control --reload-rules
#sudo udevadm trigger
###########################################################################################################
# 6. Setup Updated VSCodium repository and install VSCodium
echo "--> Installing VSCodium via official repository..."
if ! command -v codium &> /dev/null; then
# Download GPG key to the trusted keyrings path
read -rsp $'Press any key to continue...\n' -n1 key
curl -fsSL https://repo.vscodium.dev/vscodium.gpg | gpg --dearmor | sudo dd of=/usr/share/keyrings/vscodium.gpg
read -rsp $'Press any key to continue...\n' -n1 key
# Fetch the verified official repository file configuration
sudo curl --output-dir /etc/apt/sources.list.d -LO https://repo.vscodium.dev/vscodium.list
read -rsp $'Press any key to continue...\n' -n1 key
# Update index and force fresh package retrieval
sudo apt update
read -rsp $'Press any key to continue...\n' -n1 key
sudo apt install -y codium
else
echo "VSCodium is already installed."
fi
# 7. Install extensions for VSCodium
echo "--> Installing extensions for microcontrollers and debugging..."
codium --install-extension --noms-vscode.cpptools
codium --install-extension ms-vscode.cmake-tools
codium --install-extension marus25.cortex-debug
codium --install-extension raspberry-pi.raspberry-pi-pico
# Reload rules without requiring immediate reboot
echo "--> Reloading subsystem rules..."
sudo udevadm control --reload-rules
sudo udevadm trigger
echo "========================================================"
echo " Setup Finished Successfully!"
echo " IMPORTANT: Please reload your shell or run: source ~/.bashrc"
echo "========================================================"
Comments
Post a Comment