Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4997

SDK • Re: Importing an SDK project to the VS Code extension

$
0
0
See the readme, you’ll need to use the CMake Tools Extension Integration to work with projects with multiple executables (https://github.com/raspberrypi/pico-vsc ... ntegration)

“For more complex projects, such as those with multiple executables or when the project name is defined as a variable, this extension can integrate with the CMake Tools extension to enhance CMake parsing.”
I adjusted all 5 settings in settings.json as recommended:
CMake Tools Extension Integration

For more complex projects, such as those with multiple executables or when the project name is defined as a variable, this extension can integrate with the CMake Tools extension to enhance CMake parsing. You can enable CMake Tools integration during project generation under the Advanced Options. Additionally, to manually enable it, adjust the following settings in your settings.json:

raspberry-pi-pico.cmakeAutoConfigure: Set from true to false.
raspberry-pi-pico.useCmakeTools: Set from false to true.

For optimal functionality, consider enabling:

cmake.configureOnEdit: true
cmake.automaticReconfigure: true
cmake.configureOnOpen: true

When prompted, select the Pico kit in CMake Tools, and set your build and launch targets accordingly. Use CMake Tools for compilation, but continue using this extension for debugging, as CMake Tools debugging is not compatible with Pico.
I selected the Pico kit, re-loaded, also I changed the board from pico2 to pico for fun.

Upon re-launch of VS Code it does the generating of make files, and near the end there were these errors before the build step, but it built. I don't want it to auto-build on launch though. These errors seem not a problem:

Code:

[proc] The command: arm-none-eabi-gcc -v failed with error: Error: spawn arm-none-eabi-gcc ENOENT[proc] The command: arm-none-eabi-g++ -v failed with error: Error: spawn arm-none-eabi-g++ ENOENT
Now I understand that after these steps, I can click the CMake icon in VS Code to see "Project Outline" then choose Configure release, build target, debug, launch. I had never used CMake extension within VS Code before, so when I read "and set your build and launch targets accordingly" I was like, "where," but I got it now, I think. It seems to do the CMake generation as soon as you save a CMakeLists.txt, so that is nice.

Statistics: Posted by breaker — Thu Jan 09, 2025 8:48 pm



Viewing all articles
Browse latest Browse all 4997

Trending Articles