Giter Club home page Giter Club logo

Comments (11)

XeYaRiQu avatar XeYaRiQu commented on June 18, 2024 1

Got it working, thank you very much!

Cheers!

from pico-setup-windows.

XeYaRiQu avatar XeYaRiQu commented on June 18, 2024 1

Got it, thanks again!

from pico-setup-windows.

ndabas avatar ndabas commented on June 18, 2024

If you just want to build your code without debugging:

from pico-setup-windows.

XeYaRiQu avatar XeYaRiQu commented on June 18, 2024

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.

ndabas avatar ndabas commented on June 18, 2024

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.

XeYaRiQu avatar XeYaRiQu commented on June 18, 2024

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.

ndabas avatar ndabas commented on June 18, 2024

Sure, happy to help!

There is info on changing the board in the wiki.

from pico-setup-windows.

XeYaRiQu avatar XeYaRiQu commented on June 18, 2024

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.

ndabas avatar ndabas commented on June 18, 2024

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.

XeYaRiQu avatar XeYaRiQu commented on June 18, 2024

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.

ndabas avatar ndabas commented on June 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.