Comments (11)
Got it working, thank you very much!
Cheers!
from pico-setup-windows.
Got it, thanks again!
from pico-setup-windows.
If you just want to build your code without debugging:
- From Visual Studio Code, follow the steps in the tutorial.
- From the command line, use the commands in the getting started guide in a Pico - Developer Command Prompt.
from pico-setup-windows.
Thanks for your quick reply! I'm still new with cmake and all, so I seek your forgiveness if I am making amateur mistakes.
Currently, I have my workspace set up like this:
workspace
├──.vscode
├──build
├──myproject
│ ├──build
│ ├──src
│ ├──test
│ │ ├──main.c
│ │ └──CMakeLists.txt (##)
│ ├──pico_extras_import_optional.cmake
│ ├──pico_sdk_import.cmake
│ └──CMakeLists.txt (#)
├──pico-examples
├──pico-extras
└──pico-playground
I've set cmake.sourceDirectory
in .vscode/settings.json to the path of # for my project. I have also set the build path to be workspace/build.
After cmake config, I'm getting this error:
[proc] Executing command: "S:\Pico SDK\cmake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release "-DCMAKE_MODULE_PATH:STRING=S:/Pico SDK/pico-sdk-tools" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE "-DCMAKE_TOOLCHAIN_FILE:FILEPATH=S:/Pico SDK/pico-sdk/cmake/preload/toolchains/pico_arm_gcc.cmake" "-SD:/workspace/myproject" "-Bd:/workspace/build" -G "NMake Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] PICO_SDK_PATH is S:/Pico SDK/pico-sdk
[cmake] PICO platform is rp2040.
[cmake] CMake Error at D:/workspace/pico-extras/CMakeLists.txt:12 (project):
[cmake] Running
[cmake]
[cmake] 'nmake' '-?'
[cmake]
[cmake] failed with:
[cmake]
[cmake] The system cannot find the file specified
The line in question is:
project(pico_extras C CXX)
What am I missing?
from pico-setup-windows.
It looks like CMake is trying to use NMake Makefiles -- our toolchain is setup for Ninja instead. This should have been configured in your .vscode/settings.json
-- is cmake.generator
set to Ninja
?
from pico-setup-windows.
Ah, I had set the generator to use Nmake Makefile
as I was following the getting started guide.
I've removed that and it defaults to using Ninja now. Another question: I have set cmake.buildToolArgs
to -DPICO_BOARD=pico_w
in .vscode/settings.json
. Is this correct? Are there other settings that I have to change for the Pico W board?
Right now when starting up Pico - Visual Studio Code, the logs show this:
[cmake] Build type is Release
[cmake] PICO target board is pico.
[cmake] Using board configuration from S:/Pico SDK/pico-sdk/src/boards/include/boards/pico.h
Again, my sincere thanks for your assistance!
from pico-setup-windows.
Sure, happy to help!
There is info on changing the board in the wiki.
from pico-setup-windows.
Hi! Apologies for reviving this thread, I'm not sure if I should be creating a new one since I'm encountering a different issue but I didn't want to unnecessarily flood the issues page with my questions.
I've got several includes whose source files cannot be opened, while others can:
#include "pico/stdlib.h"
#include "pico/binary_info.h"
#include "hardware/timer.h"
#include "hardware/i2c.h" // Cannot open source file
#include "hardware/pwm.h" // Cannot open source file
#include "cyw43_arch.h" // Cannot open source file
The errors seem to be due to this:
#include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit (D:\workspace\myproject\test\main.c).
Opening only the pico-examples in a separate window, none of these errors appear. I've checked my settings in workspace/.vscode
and they match those in workspace/pico-examples/.vscode
.
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
from pico-setup-windows.
Did you add the dependencies in your CMakeLists.txt? For example:
target_link_libraries(my_project pico_stdlib hardware_i2c hardware_pwm pico_cyw43_arch_none)
The last include should probably be #include "pico/cyw43_arch.h"
.
from pico-setup-windows.
Ah, so cmake was the issue! I was thinking it was because of intellisense...
Is hardware/timer
under stdlib? It wasn't in the cmakelist but didn't get flagged like the others.
from pico-setup-windows.
Yes, I believe hardware/timer
is in stdlib. I usually just search the pico-examples repo for whatever library/include I need, and there's usually a minimal example which will show what you need to add to your CMakeLists.txt.
from pico-setup-windows.
Related Issues (20)
- Missing components HOT 2
- Starting picoprobe debugging with VSCode not working HOT 7
- No way to build Pico W examples from VSCode Cmake tab HOT 5
- New install not working HOT 12
- v1.5.1 does not create all registry keys anymore HOT 8
- Pico - Visual Studio Code link does nothing if VS code is not in PATH HOT 2
- Installer not checking PowerShell execution policy HOT 2
- Latest pico installer downloading as unconfirmed[random_number].crdownload HOT 2
- Problem finding path with new project HOT 2
- Installer Cant Get Pased The Choose Location HOT 2
- Installer able to install Pico_W SDK? HOT 3
- Keeping the SDK repo updated as often as possible HOT 2
- Installer not working on Windows 11 on Arm64 HOT 6
- TinyUSB are not visible in VSCode workspace HOT 4
- Use of $env:COMSPEC may be invalid in some cases. HOT 1
- No suitable code signing certificates found HOT 6
- GDB Error 1 in Visual Studio Code on Windows HOT 5
- The system cannot find the file specified. HOT 2
- Add local Visual Studio Code just like other included software HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pico-setup-windows.