How to Set Up Visual Studio Code to Program the Pi Pico (Windows)
Вставка
- Опубліковано 26 сер 2024
- This video covers how to set up a windows machine with the required toolchain to begin programming the brand-new Raspberry Pi Pico. The toolchain has been installed and Visual Studio Code has been set up to write C code, build it and upload it to the Pico. Future videos will explore how to write your own code to the Raspberry Pi Pico, stay tuned for them!
Follow up to this video discussing creating your first project in Visual Studio Code: • How to Set Up a Projec...
The links for the required software is here:
Arm GCC Compiler: developer.arm....
CMake: cmake.org/down...
Build Tools for Visual Studio 2019: visualstudio.m...
Python 3: www.python.org...
Git: git-scm.com/do...
Visual Studio Code: code.visualstu...
The commands to download the pico SDK and example projects are:
git clone -b master github.com/ras...
git submodule update -init
git clone -b master github.com/ras...
To build the example projects from the command line use the following:
cmake -G "NMake Makefiles" ..
nmake
If this video helped you, please consider leaving a like and subscribing, thank you!
You can find more embedded systems tutorials and projects on my website learnembeddeds...
-- Equipment I use regularly --
The following links are affiliate links where I may make a small percentage on qualifying sales through these links. Use the respective UK or US links listed.
Budget Soldering Iron: UK: amzn.to/3pQpvUu US: amzn.to/3bBawIJ
Breadboards: UK: amzn.to/3solZCe US: amzn.to/3dGsHiS
Jumper Cables: UK: amzn.to/37JfToi US: amzn.to/3r384S9
Camera: UK: amzn.to/3qKLwFr US: amzn.to/3pK0V7C
Lens: UK: amzn.to/380lQxp US: amzn.to/3knH3WL
Tripod: UK: amzn.to/37H0Nzw US: amzn.to/3byKHsV
All videos and tutorials on this channel and mentioned websites are for educational purposes only.
You seem to be the only youtuber, seriously looking at C as a serious alternative ... Thank You!!! I wish you luck with your channel.
Thanks Mark! I do feel like people are jumping on the MicroPython train to begin with. I will eventually cover both on this channel but I am far more comfortable with C and think C is a better option in terms of performance on microcontrollers. Glad to see that people are interested in the content here!
@@LearnEmbeddedSystems earned a subscriber. brilliant tutorial. thanks mate!
thanks! this really helped me set up a develop environment for the pi Pico;
2 things that took me some time (because I was ignorant or to fast), that might help others prevent this:
- start developer command line before the "nmake" command
- start code from the developer command line or else you will get the error:
"Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable.
Error: No usable generator found."
(Hope this prevents you guys from google-ing the living **** before realizing developer command line is really necessary)
Glad to hear this video helped! Thanks for the tips for others
Hello!
I have the same problem, can u teach me step-by-step that I can programming C/Cpp for the Pico. Sorry for my poor knowledge
I do that all but "Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found."
@@digi533
This can be solved (typically) in 2 ways:
*Option A: *
(as shown in this video from 7:47)
1. Searching Windows start menu for *Developer Command Prompt for VS 2019* under *Visual Studio 2019* folder
2. type *code*, then press *enter* to launch visual studio code from the developer command prompt (which is different from normal CMD.exe) and build again.
*Option B: *
Guessing you have windows 10:
1. From the desktop, right-click the very bottom-left corner of the screen (windows logo) to get the Power User Task Menu.
2. From the Power User Task Menu, click *System*.
3. In the Settings window, scroll down to the Related settings section and click the *System info* link.
4. In the System window, click the *Advanced system settings* link in the left navigation pane.
5. In the System Properties window, click the *Advanced* tab, then click the *Environment Variables* button near the bottom of that tab.
6. In the Environment Variables window (pictured below), highlight the *Path* variable in the *System variables* section and click the Edit button.
7. Then click *New*
8. Then add the link to the folder with nmake: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64" (or something like that, depending on your installation, try to browse to the MSVC and look what version you have installed)
9. Restart Code and try building again
from: www.computerhope.com/issues/ch000549.htm
@@JonathanvanRijn thank u, it works !!!!!!!
@@JonathanvanRijn line #9 is confusing me. Am I starting CODE when I open the developer command prompt? If not I don't know what this line means. Also Is a reboot required for this additional path to be implemented? Or is it in effect once the environment variables dialog is closed?
You deserve far more than 32 subscribers... well done, thanks for this gold mine of info.
Thank you! Glad I could be of help :)
@@LearnEmbeddedSystems do you know if you can use free RTOS or other real time operating systems on the Pico like you can on the ESP32?
I would expect a port of freeRTOS to be around the corner (if there isn't one already!), the RP2040 chip is well suited to use in an RTOS environment so many people will be interested in getting it working. I don't think freeRTOS will require much modification for it to function on the Pico. I will be sure to make a video on it once a port has been developed, or see if I can get one working.
you got your revenge haha
Thank you for this. FYI, three and a half years later, it is still mostly relevant, only Visual Studio Tools are dated 2022, not 2019. The only difference I noted was that going into VS code from the build directory left it untrusted, and so I couldn't configure the CMake tools until I had explicitly opened the C:\Pico\pico-examples folder, then it asked if I trusted the developers, ... and when I said "yes" it then enabled the CMake tools extensions. The only thing I have not been able to figure yet is what the IncludePath settings should be to get the VS Code not to red-squiggle all the includes of pico/*.h and hardware/*.h etc. Thank you for making this video, as I would not have been inclined to do this otherwise, ... It's breathtaking how complex they have made editing code, ...
An excellent walkthrough of a task that should be a lot easier. Thank you!!. One minor comment - it is correct in video but in text above: 'git submodule update -init' should be 'git submodule update --init' i.e. 2 dashes - I think that corrected to an em dash? (its only an issue if you copy and paste). But thank you again a superb video and I am looking forward to the rest.
This is a vaulable resource that I turn to on every installation of the code chain.
This is a most useful video, thank you for adding it. A colleague and I went through the install and both ended up with the same build error. This is at the VS Code stage. We found the the only way to get the build to work was to delete the folder "CMakeFiles" prior to each build. The build time for the "blink" project on my average PC is over 1 minute. There are fatal errors in NMAKE but a working hex file is created. The errors are: "fatal error U1033: syntax error : ':' unexpected", "fatal error U1077" & return code '0x2'. I hope this helps.
I found same problem.
@@flukeelectronics8866 I am having same problem
a $4 micro controller shouldn't be this hard to setup. The whole point of pico is easy projects...
I completely agree! Hopefully the whole process will be streamlined once the Arduino IDE officially supports the Pico.
@@LearnEmbeddedSystems over ayear later, and it's still impossible to do on the chromebook. The thing every school kid is supposed to have so they can experiement with this kind of easily affordable technology. It's shameful.
really? you won't pay near to nothing and the expectation is, to get a simple full idefor again ' nothing'? really?
Funny that Particle Photon can set up “Visual Studio” by loading One Thing.
Too bad New Photon costs $50.00!
Way easier watching this that reading the official setup docs. Got it working easy on Windows 7
Thanks for the great video. The Visual Studio screens and in the "getting-started-with-pico.pdf" are very difficult for my old eyes to see. It would have been better if the "Light" theme were used instead of the default Dark theme... The command windows were also very dark and hard to see...
Anyways. I finally got it working with your great directions. THANKS !!!
Thank you so much! I have 2 Pico in my drawer for more than 6 months, and while trying to use tinyusb with it, I had to go through your video to setup my environment for it. It was flawless. Lots of love! ❤
I couldnt find the uf2 file after the build process
did this happen to you?
Well Done! The clarity and conciseness of this video is exemplary. Thank You!!
Wow! I hope this process gets simplified. It will scare off many.
Arduino has announced that they are working on supporting the Pico in their IDE, so I am sure it will be much more straightforward when they do!
I just got myself a pico, and this video was really useful to set it up! Thank you! Are you going to be making videos on different projects for the pico?
That's the plan! Make sure you subscribe so you don't miss them!
@@LearnEmbeddedSystems Same here. At first I was like "Hell No, I'm not gonna do that. Gonna put the Pico in the drawer, but then I used the magic of PAUSING and i managed to get through it!
EDIT: You should sync the talking part with your visual part. Because sometimes, it was out of sync. You talk to fast xD
I spent two full days failing at this. I try your method tonight.
Nice Tutorial. I did a litte addition, I wrote a little script that checks for the VID and PID for the pico, and opens the port with a bautrate of 1200, if its not a new one, then check for the files, on the newly added drive, that are always in the pico when connected as ready to install and copy and paste the files automatically.
The Arm GCC Compiler link points to a page that is now deprecated. Thie link on this deprecated page to the non deprectated toolchain downloads page is nothing like the one you used, unfortunately. A hint as to which toolchain I need would be very useful.
This is an awesome resource for getting up and running
Cheers for the video tutorial! This process currently feels quite convoluted, so I'm hoping it'll get simpler in time. Going to try to directly control a 64x64 LED matrix with the pico using C.
It certainly is at the moment, but it should be better when support from the Arduino IDE comes out! Have fun with the LED matrix!
How did your project turn out? Did you use the PIO?
Great video. The only video which was easy to follow!
Thanks for this. I wrote down your instructions and it only came to 3.5 pages. :D
For people who are daunted by the process, I recommend using the Arduino IDE to program the Pico - it's much easier to setup. But I want to learn the Pico SDK and this tutorial was a big help.
Thank you for making this very easy to follow video.
Very good. Really appreciate the detailed approach.
Thank You! Helped me a lot
Reference material to set up - Getting started with Raspberry Pi Pico - C /C++ development wit Raspberry PI Pico (Raspberry Pi site) "8.2. Building on MS Windows"
Hello, When I installed this on another windows10 computer I had found that the latest Cmake(cmake-3.21.0-windows-x86_640) and Python(python-3.9.6-amd64) programs(date, 15.07.2021) have a problem with building the build files in pico-examples(in both the "Developer Command Prompt" and in "Visual Studio Code") and a workaround is to install the same version of programs as in this video(version cmake-3.19.3-win64-x64 and python-3.9.1-amd64). This fixed the problem.
It would be awesome if you could make this video for MacOS
SDK install now takes care of a lot of the install process for you, including shortcuts in the Start menu to initialize the development environment and launch VSC
But then having everything done automatically for you has you miss the underlying details of how it is put together, so you can customize, fix issues when things go wrong, etc.
Hello. I have the error like that when i try to build:
"Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable."
Please help me to fix this.
Thank you
Thank You, impossible without your guidance.
Hi please keep in mind that you should launch visual studio code from the developer command prompt. I didn't do so and I had a lot of troubles.
Damn VS Studio Build tools takes a while to install, I've had 4 cups of tea so far, and I', 89% complete :o
It's way faster in wsl. Simply enable wsl, get your distro of choice, fetch the packages, fetch the git repo and done.
@@nextlifeonearth Honestly, I think it's more down to my 15+ year old computer and it's E5200 than not using the WSL
@@almostanengineer it takes ages on a top of the line computer today too, it's certainly not just your computer.
But if you're on such an old computer I wouldn't even bother with Windows.
@@nextlifeonearth I 'bother' with windows because it has to run certain applications like Inventor, that are only avalible on Windows, and it's just easier to not have to dualboot to do this, and yes Inventor runs, just very very slowly.
@@almostanengineer it's kind of ironic how you run a $2k application on such an old computer.
Unfortunitly this did not work for me...as usual at many steps it's different and there were items that didn't work right or look the same...struggled but no luck. No UF2 files were in the example directory, then setting up the VS the CMake settings were not the same, then lastly the ARM compliler is no where to be found under the No Kit Selected.
Thabks for the vid. Still waiting for my first pico kit to arrive but thid is helpful to know it can be done. A lot of the tools I'm familiar with and makes sense given how they plug together. Feels like a decent sh or bar script could automate much of this and technically VSCode could provably be made to do all of this for us given admin privileges. Embedded is a far cry from my area of expertise but might give automating all this chaos a shot if I find a chance!
I added the "Nmake makefiles" in the CMake Tools -> Preferred Generators section.. so why do I see this when I open the pico-examples folder in VS Code?
[main] Configuring project: pico-examples
[main] Building folder: pico-examples
[proc] Executing command: "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\13.2 Rel1\bin\arm-none-eabi-gcc.exe" -v
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
I fixed my problem by adding these lines to the VS Code settings.json file:
"cmake.cmakePath": "C:\\Program Files\\CMake\\bin\\cmake.exe",
"cmake.generator": "Visual Studio 16 2019",
Please make a video to demo how to debug pico
Either by picoprobe or using ST Link
Thank You
I agree!, would really like to see that on Windows, if possible =)
SUCCESSFUL compilation after a month..first it is very important to use vsc command prompt not cmd or powershell, if nmake is used. however it was not possible for me to use it within the visual studio code editor (rare). this uses the normal cmd or powershell neither of these two compiles with cl always says cl.exe broken.
For this reason and thanks to the internet I found that it was possible to use MinGW and not VC. with the command inside the build folder "cmake -G '' MinGW Makefiles .." "and then use nmake and voila !!!.
and this works in cmd powersell and visual studio code just remember to install the GCC and G ++ tools and register your environment variable.
Another tip for usb support use "git submodule update --init" from the git console to complement the SDK that is downloaded by default which does not have this support.
I hope this helps someone else since for me it was quite painful.
thank you!
Well I have tried this for a second time. I got further this time. But mine fails during the nmake process. The first sign of a problem is when I get a Detecting C compliler ABI info - failed
Also I notice when mine is checking for working C compiler: it is looking in /bin/Hostx64/x64/cl.exe while yours is looking in /bin/Hostx86/x86/cl.exe When mine looks in this x64 path it returns cl.exe - broken It is all down hill from there. :-(
Nice, thank you, still found it a struggle (my machine is 'complex' shall we say) but this gave me most of what I needed.
I'm glad to hear that! It does seem to be a somewhat convoluted workflow.
@@LearnEmbeddedSystems Yeah, it's not an easy one to get up and running, Linux was a doddle in comparison.
Hi, I could not setup. "Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found."
I setup the settings.json as you mentioned - adding at the end. I setup the path to
Any help on this?
what would you do differently to setup on mac?
NOTE: I have gotten this to work but the .uf2 files are not generated. Seems some type of setting/bug somewhere and there is no errors to point to a cause. :/
Thanks a lot. Good job. I take your example))) Thank you
Why do you set the PICO_SDK_PATH TO "..\..\pico_sdk" rather than "C:\[whatever]\pico_sdk" ?
I went through it twice and it doesn't build. Files are there in the pico-examples folder.
D:\Pico\pico-examples\Build>cmake -G "NMake MakeFiles" ..
CMake Error: Could not create named generator NMake MakeFiles
no capital F in Makefiles in the command
@@senpaisimon_ I'll check it out. Thanks
Is it important that the Visual Studio Code be version 2019? I installed 2022... At 50% after running nmake, there's some error message. NMAKE: fatal error U1077: '..\..\PIOASM\PIOASM.EXE -O... then a whole slew of other stuff. I think it was just Norton stopping something it shouldn't have that was a dependency but redoing the nmake command just results in it stopping at about 50% again.
At 8:21 VSC 2023 the way of entering path is now different from your video. I'm stuck. No way to set a value here.
7:11, I press the bootsel button and power pico pi, but I don't get the RPI drive.
What might be the possible issues?
VS code is a powerful tool, a bit much for the Pico, I like Thonny, I like its simplicity and efficiency
Confirmed still works in October 2022
one cavate: you will need to close and open the dev console again before opening code else you'll get not found error
When I tip cmake -G "NMake Makefiles".. in the developer show me a warning like this
"CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases." so I need help to solve it
Did you solved it?
I have done everything same. But the blink.uf2 just reboots the raspberry pi pico w. led doesn't flash. Does anyone have an idea?
Helped a lot.subscribed
Glad you found this useful!
If you get the error:
[build] blink\CMakeFiles\blink.dir\compiler_depend.make(4) : fatal error U1033: syntax error : ':' unexpected
Then the problem is probably the version of CMake you are using. Go back to 3.19 DO NOT USE 3.20
Thank you for the tip!
While I successfully configured my laptop, I can't still "understand why is it (still?) depending on 2GB worth of M$ C++ Build Tools to build something with GCC compiler which is not even remotely meant for windows... :-/
Thanks for a great video
Thank you for one of the best tutorials I have seen on UA-cam! But I also have the same problem as others have reported - is there no solution or have I missed something? (Running by typing code into the Dev Console produces the same result): [main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator. Attention to this would be a big help for those who have got this far and can't proceed! Thanks again.
And with a red face, I must admit I'd inadvertently typed Nmake instead of NMake in the json editor...problem in chair not in computer ;-) I'll leave this comment for anyone else who might make the same mistake and again say thanks for an excellent tutorial. My only wish is that the screens would have been a bit larger to make it easier to read.
Buenisimo, al menos por linea de comandos puedo generar los archivos. Justo lo que necesitaba. Gracias!
Really great. Thanks
I need help there are no .uf2 files in any locations
I couldnt find the uf2 file after I did the build process
Can anyone help with this issue?
Same Problem "nmake" does nothing: 'nmake' is not recognized as an internal or external command. Very frustrating after one hour following the tutorial..
I'm having the same issue. I have added it to my PATH environment, but still no joy.
Found any solutions? also tried adding it to PATH but got fatal error U1077: return code '0x2'
@@kalidgomez7988 I had the same problem, but solved it. I reinstalled python, on custom instalation, aplying it to all users. Then i installed notepad++ and used it on the git installation. And now it's all solved.
Hello,
Working with CMD don't work.
I had to download load manuały from GitHub.
Because repository don't exist.
And also VSC from CMD also don't work. Do someone know how to configure this?
this worked great for a while, but today visual studio stopped generating uf2 files. any ideas?
The video is amazing and very helpful; just having one issue, if anyone can help me out, the compiler is not showing up in Visual Studio Code.
Hello everyone, I know some of you may have the issue with > cmake -G "NMake Makefiles" .. failed. I had it too, just find another video which very helped. If you cannot do it from you command prompt window. then open your VS code. Setup the "Setting-> cmake" and make sure the "cmake : configure environment" and "cmake generator" have the information you need, then click the "build" on the bottom of the VS code, choose "GCC version(13.2) xxxxxxx". The VS code will install the cmake for you. if you still have question, you can looking for this video, "RASPBERRY PI PICO ON WINDOWS! | Step by Step Tutorial on How to Configure your PICO on Windows." it has everything you need. I made it happen with this guide.
Is this the same as the other video with the "Windows Pico Installer"? I was just watching it yesterday for the first time and it was gone when I woke up.
This is the harder way but it should still work - I'm sorry the previous had a small error that I will try to correct and have back up shortly
It would be interesting to see tutorials for alternative development environments. MacOS and /or Linux and for IDEs Visual Studio instead of VisualStudio code and CLion.
Yeah MacOS 👍
Hi I have a problem with developer command prompt, when I write the command "cmake -G "NMake Makefiles" .. " , it shows to me some problems: Compiler 'arm-none-eabi-gcc' not found, you can specify search path with
"PICO_TOOLCHAIN_PATH". I've tried to fix this but I didn't succeed, can you please tell me how to solve this?
If you get the error "blink\CMakeFiles\blink.dir\compiler_depend.make(4) : fatal error U1033: syntax error : ':' unexpected" Installing Cmake 19 instead of Cmake 20 worked for me. I also uninstalled and re-installed Visual Studio. Not sure if that had an effect.
Hey there, great tutorial and straight to the point, only problem for me is that when I click build, it says ''Unable to determine what CMake generator to use.'' Also I am a bit of beginner so this might be a dumb question, but the outcome is that I can create programs in vscode and then drag and drop them into pico to run them instantly ? In that case would it be possible to for example work with console input and output, or this is mostly for programs where pico only interacts with things soldered on its pins ? Also, this works only for C ?
we have the same problem. If you could handle it, could you help us?
@@hilalkeles7832 we firstly need the tutorial creator to answer us
@@nonridiculousadjective6597 then ?
Can you help me ?how can I fix?
@@hilalkeles7832 you misunderstood, i don't know how i can fix it, that's why i wrote the initial comment..
theres a mistake in the description git submodule update -init only has one dash instead to two --init
Hi, I do some issues when I follow with your excellent tutorial. I loaded the code from VS2017 develop environment and all the things went okay. However, when I hit the Build button, there was a error message:
[build] blink\CMakeFiles\blink.dir\compiler_depend.make(4) : fatal error U1033: syntax error : ':' unexpected;
[build]NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86
make.exe"' : return code '0x2'.
I really have no ideas about this error.
did you figure what's wrong ?
cmake -G "NMake Makefiles" .. results in several errors. It seems to indicate that some environment variables are not set, such as CMAKE_C_COMPILER, etc...
I got Raspberry Pi Pico SDK version 1.3.0 (or later) required. Your version is. Any help on that
I had to move pico-sdk to my C:\ not C:\Pico
Hey! Please help me. I did what you said. But in the last part vscode fails. Cmake can't find the way . Can't find which one to use. How can I fix ?
Sorry, Developer Command Prompt does not come up in Start Menu, what am I missing??? Now I am stuck
hhey theres an error whenever i run git submodule update -init and it is error: pathspec '-init' did not match any file(s) known to git
even though this comment is from a month ago Its 2 dashes
@@If0n702 it has been so long that i had alredy dreamnt oh snorting 2 lines of cocaine
Hi- thanks for the video! I'm having issues with building the Pico examples with Cmake after having configured the environment and preferred generator settings for Cmake Tools in VSCode. I get "Unable to determine what CMake generator to use." Configure environment has been set to PICO_SDK_PATH and ..\..\pico-sdk and the preferred generator has been set to "NMake Makefiles"... is there something else I'm missing?
I had this; what fixed it for me was closing VS Code (I'd opened it from the taskbar) and opening it from the VS Developer prompt by typing "code"; then it worked and I could build from VS Code;
also check
Jonathan van Rijn's solution below ref adding the location of nmake.exe to the path, then VS Code can be launched from outside the developer prompt.
@@kbobiller Ah, I see- I also opened VS Code from the taskbar and didn't realize that opening it from the command prompt would make a difference. That seemed to work, thanks. :) However, I'm now getting a syntax error while trying to build pico-examples: "[build] blink\CMakeFiles\blink.dir\compiler_depend.make(4) : fatal error U1033: syntax error : ':' unexpected". Looking in that file, there's a comment in it that says "DO NOT EDIT!", and I'm not sure where I'd start even if I were to edit it. Perhaps I configured the extension settings incorrectly...?
@@aminafoxdye I have this same error. No clue what it is talking about.
@@aminafoxdye Not sure if it will work for you but I deleted the folders from the "build" folder that were created in terminal earlier i.e. "blink" "clocks" "cmake" "divider" ..... "watchdog" etc but left all other files/folders inside the "build" folder alone ("CMakeFiles" "elf2uf2" etc) clicked on build and it ran with no errors
@@daviddoidge1252 That worked for me during the initial build in VSC- however subsequent builds beyond that produce the same syntax error I was getting before.
ver nice tutorial
Seems like this tutorial could use the magic of wsl instead of vs build tools.
Hi..After loading pico-example as a workspace to VS code, I'm facing an issue. can you let me know what I'm doing wrong here, I tried many options available to overcome the error but still cannot able to solve this, FYI;
[proc] Executing command: cmake --version
[proc] Executing command: cmake -E capabilities
[variant] Loaded new set of variants
[kit] Successfully loaded 6 kits from C:\Users\Akshay\AppData\Local\CMakeTools\cmake-tools-kits.json
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --version
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" -E capabilities
[proc] Executing command: "C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gcc.exe" -v
[proc] The command: nmake /? failed with error: Error: spawn nmake ENOENT
[cmakefileapi-driver] Removing c:/Pico/pico-examples/build/CMakeCache.txt
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
[main] Configuring project: pico-examples
[proc] Executing command: "C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gcc.exe" -v
[proc] The command: nmake /? failed with error: Error: spawn nmake ENOENT
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
[proc] Executing command: "C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gcc.exe" -v
[proc] The command: nmake /? failed with error: Error: spawn nmake ENOENT
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
I get the same. Did you solve this?
I would imagine all this will put many people off using C on the Pico, it does for me. There needs to be a simpler all in one install with minimal setup and the feel of using something like Codeblocks or Geany or a "Thonny for ARM GCC" when working on code and a one click compile to .uf2 file without all the Git commands and and CMAKE business.
thanku so much!!!!
why is it not possible to downlaod all these packages and tool chains from within VCODE extensions ?
I had some issues when running cmake. After trying a bunch of things, it turns out my antivirus was trying to "protect" the files, and denied permission to cmake. If you have similar issues, try disabling the antivirus for a few minutes, or allowing cmake to do whatever it wants
thankyou for the video, but i have a question. what's the python for?
This is much too complicated and way too fragile. The Pi Foundation docs seem to assume you'll dedicate a machine to the development environment for the Pico and not do anything else with it, which is well and good if you use a Pi 4 but hardly practical with a Windows or Mac. I think the way to go is a Docker container with the compiler and build tools using VS Code as the IDE. On Windows, the container can run in WSL2 controlled by VS Code on the Windows side. On the other platforms the same container should run natively (I think). I'm on a huge learning curve with Docker and VS Code, but this is the sort of thing a devops expert can set up once and everyone can benefit from.
Hi, thanks for taking the time to product this excellent tutorial. I have followed the steps, but it falls over on the build. I can get Cmake to work and produce the makefiles, but when the build process starts I get:
[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/pico-examples/build --config Debug --target blink -j 10 --
[build] Warning: NMake does not support parallel builds. Ignoring parallel build command line option.
[build] The system cannot find the file specified
[build] CMake Error: Generator: execution of make failed. Make command was: nmake -f Makefile /nologo blink &&
[build] Build finished with exit code 1
Any ideas?
how do import library's
On Win11, after hit "cmake -G "NMake Makefiles" .. " I have getting an error:
CMake Error at pico_sdk_import.cmake:44 (message):
SDK location was not specified. Please set PICO_SDK_PATH or set
PICO_SDK_FETCH_FROM_GIT to on to fetch from git.
Call Stack (most recent call first):
CMakeLists.txt:4 (include)
Does anyone know the reason? :(
Helpful video. However, if your Display was larger, with bigger Font size, then, your viewers could see what you are typing on the screen, better.
Does anyone know how to resolve the include errors? They pop up when you try to edit / make new code. The autocomplete fails to detect the headers from the sdk.
Please do the equivalent for installation on the Raspberry Pi, that would be very useful.
Thanks for the suggestion Richard, I will add this to my list of video topics to cover!
@@LearnEmbeddedSystems I have tried on Raspberry PI, and failed. It just seems such a convoluted process to set it up just to program in C. It would be nice to see a way to use the VS IDE with C/C++ and a smooth testing cycle like it is with Thonny and Micropython.
Does this work with other languages or do I have to do something else for python?
This is just a C/C++ tool chain
I have tried following your instructions to the letter, and encounter an error every time I run NMake. I get "CMakeFiles/hello_usb.dir/hello_usb.c.obj: No such file or directory". NMake then fails with a fatal error. There are some ASCII symbols next to the file path, which I suspect are the cause of the problem. However, I'm having trouble figuring out where the error might be coming from. Does anyone have any suggestions on where to find the list that CMake is running through?
Edit: I seem to have solved the problem by downloading the version of CMake used in the video, rather than the current version.
You are correct, you need to downgrade Cmake to version 3.20.5. The latest version of Cmake adds a Byte Order Mark (BOM) to the beginning of the file (those funny ASCII symbols you saw). The compiler also added BOM support in its latest version, but apparently not in all cases.
So my build chain works and I can build the pico examples without an issue. Copied the blink code to my pico and it works. The issue I'm having is in visual studio code, I've set up the preferred generators and added the PICO_SDK_PATH, but I keep getting the following error: "Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json". Any assistance will be much appreciated. Thanks
same
CMake Error: Generator: execution of make failed. Make command was: nmake -f Makefile /nologo all && help me
Hello there....i set up everything as stated in the video and my rp2040 board led blinks. However the VS code part of the video doesn't build.
This is the error i get.
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
Please note that i put the "NMake Makefiles" in the prefered generator json file as stated in the video
I found the solution and it is...Don't open VS Code from the start menu/desktop icon...
Rather open developer command prompt for visual studio, type "code" and press enter
The VS Code opened this way loads with all the settings and configs of the pico....so there's no longer errors.
C:\Pico\pico-examples\build>cmake -G "NMake Makefiles" ..
CMake Error at pico_sdk_import.cmake:63 (message):
Directory 'C:/Pico/pico-examples/ ../ pico-sdk' not found
Call Stack (most recent call first):
CMakeLists.txt:4 (include)
it s very heavy toolchain specially microsoftbuild
there is no alternatif more lightweight?
I expect there will be when the arduino IDE supports the RP2040