Supporting PlatformIO and non PlatformIO development on same system/

Is it possible to have PlatformIO in VSCode for ESP32 development (Arduino Framework) and use VSCode for Raspberry Pi Pico SDK development which is not PlatformIO.

My experience is that they are not compatible. Does anyone have this setup right so both work?

What exactly breaks when using them together? The Pico SDK uses CMake which should be fine with PlatformIO if it’s not ESP-IDF you’re targeting. EDIT: Corrected below.

My first attempt didn’t work, but it could have been several issues; I don’t know. If ESP32 Arduino Framework under PlatformIO will not screw up the Pico CMake, I’ll try again.

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,
    }

So I have a few problems combining the PlatformIO with the VSCode setup for Pico. At first with Pico C/C++ debug working with SWD connected, I then install PlatformIO and could setup to build and upload the Blink sketch. Then I hooked up the ESP-Prog JTAG debugger and added the 2 lines needed for the debugger:

debug_tool = esp-prog
debug_init_break = tbreak setup

Now when I try to run the debugger I get this message popup.
Running the contributed command 'cmake.launchTargetPath' failed.

If I setup PlatformIO for just ESP32 debugging without the Pico development setup before hand I don’t get this message. It sounds like I need to keep it from doing anything with cmake for PlatformIO