Getting started with Raspberry Pi Pico
Figure 9. Building the
pico-examples
project in Visual
Studio Code
As we did from the command line previously, amongst other targets, we have now built:
•
hello_usb.elf
•
hello_usb.uf2
7.3. Debugging a Project
The
pico-examples
the application CMake is configured to build. Go ahead and copy this file (
examples/.vscode
settings.json
buttons that attempt to run a Pico binary on the host).
$ cd ~/pico/pico-examples
$ mkdir .vscode
$ cp ide/vscode/launch-raspberrypi-swd.json .vscode/launch.json
$ cp ide/vscode/settings.json .vscode/settings.json
Pico Examples:
https://github.com/raspberrypi/pico-examples/tree/master/ide/vscode/launch-raspberrypi-swd.json
1 {
2
"version": "0.2.0",
3
"configurations": [
4
5
6
7
8
9
10
7.3. Debugging a Project
, which is used by the debugger
, which can be dragged onto the RP2040 USB Mass Storage Device
repo contains an example debug configuration that will start OpenOCD, attach GDB, and finally launch
directory as
. We also provide a
launch.json
removes some potentially confusing options from the CMake plugin (including broken Debug and Run
{
"name":
"Pico
Debug",
"cwd": "${workspaceRoot}",
"executable": "${command:cmake.launchTargetPath}",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
launch-raspberrypi-swd.json
file that we recommend you also copy. This
settings.json
Lines 1 - 27
) into the
pico-
27
Need help?
Do you have a question about the RP2040 and is the answer not in the manual?