On Linux, VSCodium needs special launch parameters to work with the Pico extension. The Microsoft version of VSCode works out of the box.
Setup for CAT Suite
If you’re using a CAT Suite computer, you need to boot into Red Hat Linux. The Windows installation is missing Git, so you can’t use it for this workshop. Reboot from Windows, and wait until you get an option to choose Red Hat.
The CAT Suite computers come with VSCode preinstalled.
A word of warning
Using a CAT Suite computer is a degraded experience compared to a computer you own. You will not be able to interact with the Pico over the serial port or using Picotool.
Additional setup step
Once you have opened the repository in VSCode, run the following commands to fix the CMake errors:
Inside VSCode, go to the File Explorer. Press “Clone Repository” and paste the following URL: https://github.com/EEESAU/pico-workshop.git
Once the project is opened, VSCode will automatically begin downloading the toolchain for Raspberry Pi Pico.
You might have to say “Yes” to “Do you want to import this project as Raspberry Pi Pico project?”
View the progress in the notifications at the bottom right.
This step can take a few minutes as the toolchain is downloaded and installed.
Ensure you have the following settings set:
SDK: 2.1.1
Board: pico2_w
Uploading code to the Pico
Once the toolchain is finished downloading, VSCode will open the new project.
Open the file onboard_led.c in the root directory.
This is a short program that turns on an LED built onto the Raspberry Pi Pico 2 W.
To compile the code, choose Compile Project from the sidebar menu.
Once the compilation is finished, the executable files will be inside the build folder.
These files are specially built for the Raspberry Pi Pico 2 W, and they won’t run on your computer. To see how they work, we need to load them onto the Pico so it can run them.
BOOTSEL Mode
BOOTSEL (Boot Select) is a special mode that you put the Pico in whenever you want to upload new code.
To put the Pico into BOOTSEL mode:
Unplug the USB cable. (If you already had it plugged in)
Hold down the BOOTSEL button.
Plug the USB cable back in.
Release the BOOTSEL button.
You should see the Pico appear as a USB storage device on your computer.
To upload new code, drag a .uf2 file onto the Pico storage.
Put the Pico into BOOTSEL mode, then drag and drop the file build/led-tester.uf2 onto it.
Once the file finishes copying, the Pico will disconnect and the green light will turn on. It just ran our code!
At this point, you’re ready to move on with the rest of the workshop. Go to Basic Programming first.
Manual Setup (If you don’t want to use VSCode)
Follow these steps to setup your toolchain without using VSCode.