0

I am attempting to import this github PICO project written in C into VSCode using the "Raspberry Pi Pico" extension. VSCode is hosted on a Ubuntu computer (not a Raspberry Pi).

The result:

CMake fails to run inside of VSCode. However, if I manually perform cmake (delete & re-create the build directory and run cmake from within the build directory), VSCode will then successfully compile the project and flash the PICO. However, after flashing the PICO, VSCode fails at starting the debugging session. Since I can run cmake manually, I would like to solve successfully debugging the C code on the PICO first.

Some background:

Using the command line, I can run cmake (as mentioned above) on the above linked to github project, run make, start OpenOCD and program the PICO and connect a instance of GDB-MULTIARCH to the OpenOCD server.

For all programming and debugging, I am using a "Raspberry Pi Debug Probe". For all testing, the target PICO is a PICO W.

To verify the VSCode installation and PICO related development tools the "blink" example project from the "Raspberry Pi Pico" VSCode integration was opened in VSCode and was successfully programmed into the PICO.

More background:

When starting out, I didn't know how VSCode worked. So here are some observations I have made to help any who would like to contribute. VSCode needs a directory in the project's root directory called .vscode. Inside are about half a dozen JSON file which direct VSCode on matters such as where the development tools are located, how to run cmake, ect. Instead of creating this from scratch, a VSCode "Integration" called "Raspberry Pi Pico" was created to import (adapting) existing PICO project into VSCode. And, by doing so, creates the .vscode directory and all the necessary JSON files within it. The content of these JSON files depends on many things. Some I am still trying to understand. Among them, the platform VSCode is running on might be a Windows, Linux, Mac or Rraspberry Pi.

The VSCode About output:

Version: 1.96.4
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Date: 2025-01-16T00:16:19.038Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Linux x64 6.8.0-51-generic snap

There is a lot of data in log files. Instead of dumping them all here, leave a comment as to what might help and I'll modify this question.

7
  • Well, I've made it about as far as you did. I have many pico and Pi projects I use vscode (vscodium) to work with, however I've always preferred just opening the terminal to build and then flash with openocd to the pico (I have a couple of shell scripts that handle that). Debugging through openocd works from the terminal. The myriad of .json config files, both in your .vscode project directory and the normal config in ~/.config/VSCode all have to work together to provide integration. I have all header and library integration working, but haven't tried the build or debug within. Commented Jan 27 at 22:29
  • I use a 2nd pico as the debug probe. The difficult part has always been the daisy-chain of layered config files. Hopefully a vscode (on Linux) wizard will drop by and will help us both out. Commented Jan 27 at 22:32
  • There's a ~/.config/VSCode directory in Linux VSCode installs?! Oh! I've got to check that out. Commented Jan 28 at 0:03
  • What gets me, I can successfully do everything in VSCode from the cmake to debug/single-stepping while using the blink project found under the VSCode "Raspberry-Pi-Pico" Integration examples. And, when I check, the .vscode files between that and the brickpico project nearly match. I ran out of stamina, but my next step is to make them match and see if the blink project still works and the brickpico project is still broken. Commented Jan 28 at 0:07
  • Yes, I'm trying to sort that out. That generally points to a problem in the CMakeLists.txt file, but I looked at the file from the Bricpico repo you linked to, and nothing stands out. I'll have time in an hour or so to launch vscode and attach a pair of picos. Commented Jan 28 at 1:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.