Supporting PlatformIO and non PlatformIO development on same system/

I use PlatformIO in VSCode for nRF5/STM32/ESP32 and recently added Raspberry Pi Pico.

There may be another way but for now to avoid any potential conflicts, I have the CMake extension installed. It adds its own set of buttons at the bottom of VSCode IDE next to the PIO ones for builds/debugging.

I’m not sure where things are with PlatformIO support for the Raspberry Pi Pico but hope it is on the roadmap soon.

You need to setup a launch.json in the Pico’s project .vscode folder.

Here is the launch.json, for demo project where path is the path to the pico-sdk install.

  "configurations": [
    {
      "name": "Cortex Debug",
      "cwd": "${workspaceRoot}",
      "executable": "${workspaceRoot}/build/demo.elf",
      "request": "launch",
      "type": "cortex-debug",
      "servertype": "openocd",
      "device": "Pico2040",
      "configFiles": [
        "interface/raspberrypi-swd.cfg",
        "target/rp2040.cfg"
        ],
      "svdFile": "<path/pico/pico-sdk/src/rp2040/hardware_regs/rp2040.svd",
      "runToMain": true,
    }