raspberrypi / pico-vscode

The official VS Code extension for Raspberry Pi Pico development. It includes several features to simplify project creation and deployment.
https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico
Mozilla Public License 2.0
132 stars 16 forks source link

cannot launch Pico-Debug (Cortex Debug) on Windows #67

Closed jdbruner closed 2 months ago

jdbruner commented 2 months ago

Attempting to debug with openocd on Windows fails, because the launch configuration in launch.json contains this:

    "overrideLaunchCommands": [
        "monitor reset init",
        "load \"${command:raspberry-pi-pico.launchTargetPath}\""
    ],

On Windows, launchTargetPath is delimited by backslashes - which are interpreted as escape sequences, so the load command fails (file not found).

A workaround is to delete this (assuming the image is going into flash). An alternative workaround is to use the command variable extension and replace the backslashes with forward slashes.

paulober commented 2 months ago

Have you enabled the useCmakeTools setting for the extension or in your workspace?

jdbruner commented 2 months ago

Yes, I was using useCmakeTools (so I could debug multiple executables in the same project, as I noted in #68), and I see from the PR that that was relevant. Sorry I didn't mention it initially. Anyway, thanks for the fix.