Blink LED in C/C++ on the Raspberry Pi Pico [Linux SDK Setup]

  Переглядів 38,450

Low Level Learning

Low Level Learning

3 роки тому

In this video, I'll show you how to set up a build environment for your C/C++ RP2040 projects in Linux. Using CMake and Make, learn how to compile code and upload it to the RP2040 Raspberry Pi Pico. The Raspberry Pi Pico build environment that comes with the pi-pico-sdk makes developing and uploading files to the RP2040 extremely easy.
Today, we're going to talk about the RP2040 SDK, and how to setup and build programs for your RP2040. We'll write the blink LED example in C, and flash it to the RP2040.
Learn how to use the Raspberry Pi Pico SDK to create a custom build environment and do the Blink LED tutorial in C.
Buy the RP2040: amzn.to/3uISUGn
Join us on Discord!: / discord

КОМЕНТАРІ: 62
@chuckmuckamuck8001
@chuckmuckamuck8001 3 роки тому
I am more excited about a blinking light than I probably should be, thanks!
@glugblub7524
@glugblub7524 3 роки тому
way more haha
@JimMaz
@JimMaz Рік тому
Very well explained and pertinent
@saffiervanderhoef2547
@saffiervanderhoef2547 6 місяців тому
good video relatively easy to follow and understand
@anthonyheak3479
@anthonyheak3479 Місяць тому
Thank you, it was very explained!
@suvirkumar3237
@suvirkumar3237 Рік тому
Cool a very nice and concise guide to getting started with cmake and bcc. Appreciate your hard work.
@LowLevelLearning
@LowLevelLearning Рік тому
Glad you liked it
@XStance7
@XStance7 Рік тому
@@LowLevelLearning How can we set this up for Mac M1? Any Advice?
@minhajsixbyte
@minhajsixbyte 7 місяців тому
@@XStance7 you can start with looking up for the equivalent brew packages
@lottalava
@lottalava 2 роки тому
awesome tutorial, thank
@francisstapp1583
@francisstapp1583 Рік тому
this tutorial saved the one of the two brain cells i have left
@Qw3r3wQ
@Qw3r3wQ 2 роки тому
From where do you get this : set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR}) ? and you did not mention installing arm-none-eabi-gcc-cs-c++ ;)
@jackyli6716
@jackyli6716 3 роки тому
great tutorial!
@jamesbailey3131
@jamesbailey3131 3 роки тому
Great tutorial, clear and professional. Have you done anything with the little OLED displays SSD1306 - I've got a 128x32 and a 128x64 but the few examples I can find for the Pico are all C++ and I would really like to stick to C if possible.
@LowLevelLearning
@LowLevelLearning 3 роки тому
I haven't, but I think theyre controlled over I2C. I plan to do SPI and I2C tutorials soon. Thanks for watching!
@yahmk3978
@yahmk3978 2 роки тому
Thank you very much!
@LowLevelLearning
@LowLevelLearning 2 роки тому
You're welcome!
@mytechnotalent
@mytechnotalent 2 роки тому
Do you know of a good NRF2401 C ONLY driver and example for the Pico? I have seen C++ versions but really look for a pure C one with a good send/recv example.
@barchilsaid3001
@barchilsaid3001 2 роки тому
Thanks :)
@LowLevelLearning
@LowLevelLearning 2 роки тому
Anytime :)
@carbonanimationproductions6537
@carbonanimationproductions6537 Рік тому
is there a tutorial for c++ and raspberry pi robotics? i really wanna learn
@fusca14tube
@fusca14tube 3 роки тому
First of all, thank you! Great explanation. But, what about Pico C LED blink bare-metal video, just like you did with Arduino? :)
@LowLevelLearning
@LowLevelLearning 3 роки тому
Great suggestion!
@renechawy
@renechawy 3 роки тому
Mr LLL, a little ARM ASSEMBLY example in the future ? Currently no videos on Pico just Rpi-board: $ as $ ls $ gdb (or GDB server) But those for OS-RPI
@jvernice
@jvernice 2 роки тому
My CMakeList.txt looks nothing like yours when I downloaded the examples. Was this completely re-written by you? I am new to Cmake. Been using Arduino and venturing into Raspberry Pi Pico
@unoseemek3490
@unoseemek3490 Рік тому
not sure if the software has changed over time but could you explain what you mean when you say to install cmake? anytime I try to put in "sudo snap install cmake" my chromebook just tells me "sudo: snap: command not found" (6:16 in the video)
@michaelsnater2345
@michaelsnater2345 8 місяців тому
You need to install cmake. Snap is the way he does that. There are others. For example I typed this command into my terminal(Msys2): pacman -S mingw-w64-x86_64-cmake
@hoangnguyen6162
@hoangnguyen6162 2 місяці тому
Ah that's because you don't have the `snap` installed. If `cmake` is somewhere in your package repositories. With sudo priviledge, run the command for installing `cmake` using your GNU/Linux distro's package manager. For example `apt install cmake` (on Debian GNU/Linux and derivatives) or `pacman -S cmake` (for arch btw and derivatives).
@warrenyoung5282
@warrenyoung5282 Рік тому
I followed your youtube. I get an error "fatal error # include cstdlib no such file or directory" I have tried using the raspberry pi sdk instructions to run blink and get the same error. Where should I look for this file.
@michajoko7534
@michajoko7534 Рік тому
How I can mount the raspberry pi pico filesystem without unplug and plug into the USB Port (with holding the BOOTSEL button), like in your video?
@minhajsixbyte
@minhajsixbyte 7 місяців тому
i am looking for this too. have you been able to solve it?
@parsishashank
@parsishashank 3 роки тому
It will be helpful if you could explain connection of hardware
@jyvben1520
@jyvben1520 3 роки тому
pico -> (usb mini) usb cable with standard usb 2 type A in pc/laptop/raspberrypi
@blup737
@blup737 Рік тому
bro how to learn Raspberry Pi Pico programming (c/c++)
@michaelsnater2345
@michaelsnater2345 8 місяців тому
My 'cmake ..' command did create a lot of things.....makefile not being one of them. Why do you think that is?
@minhajsixbyte
@minhajsixbyte 7 місяців тому
is the CMakeLists.txt exactly same as it is shown in the video?
@larsclausen3586
@larsclausen3586 Рік тому
I got to the 7:32 mark, the make moment, and the first line looks like in the video, but then after that about 200 errors. The first line says Assembler messages, then next line S89: Error unknown pseudo-op: '.syntax', and then about 199 more of the same. Any ideas? Thanks
@larsclausen3586
@larsclausen3586 Рік тому
Tried again from scratch this time on a newly fresh install of a raspberry pi 4. This time i got only about 70 errors. All goes fine until 93% progress, then it says pico_standard_link/new_delete.cpp.obj and then follow 70 errors of stuff not defined.
@roryjones6483
@roryjones6483 Рік тому
What’s the IDE you’re using? Sublime?
@PriyanshuAman-dn5jx
@PriyanshuAman-dn5jx 2 місяці тому
Vim
@robotboy3525
@robotboy3525 Рік тому
Hi, I'm curious. I really want to know how your CMakeLists.txt is much different from the one in the git repository. How did you came about to write this ?? Anyways, the one in the git repository didn't work for me but yours worked perfectly and i made no modifications to my blink.c I have actually looked up in the Raspberry Pi Pico C/C++ SDK pdf and didn't find any info on how you set your CMakeLists.txt to be the way it is. Eventually, i will be writing my own project and i will need to write my own CMakeLists.txt to suit my codes. Thanks a lot for your tutorial. It's my first time getting into c/c++ baremetal armeabi.. gcc stuff and i wouldn't have been able to get this going without this tutorial
@jacobholder8188
@jacobholder8188 2 роки тому
Which Linux distro is he using for these tutorials? I’m at a loss.
@minhajsixbyte
@minhajsixbyte 7 місяців тому
distro does not matter. he is using ubuntu. it might look different because he is not using any "traditional" desktop environments. its all the same under the hood.
@HitAndMissLab
@HitAndMissLab Рік тому
it would be nice if you made this video few minutes longer and explain how you connected into the Raspberry Pico and how you connected Pico to the web etc. Otherwise great video.
@slzckboy
@slzckboy 11 місяців тому
pico cant connect to the web.What he didnt makeclear was that he was running the commands from either a linux pc or a rasberry pi4 etc.However i did manage to blink an LED from watching this so i think he did ok.
@magnum_dingus
@magnum_dingus Рік тому
"I'll put this link in the description." *doesn't* What a chad.
@mitchellmigala4107
@mitchellmigala4107 Рік тому
I have gone through this over and over what a nightmare. In the end the make fails. I deleted everything several time and went through again. everything works up until make. Then I get a whole bunch of errors when it hits elf2uf2
@unoseemek3490
@unoseemek3490 Рік тому
same, have you figured out how to solve this yet?
@mitchellmigala4107
@mitchellmigala4107 Рік тому
@UNOSEEMEk yes, I did but I can't remember what it was. The process for using C or C++ is a joke or at least was 9 months ago. I gave up and started using circuit python and micro python with thonny. It is much easier to get your code built and running on them with that.
@minhajsixbyte
@minhajsixbyte 7 місяців тому
arm-none-eabi-newlib check if anything changes after installing this package.
@henkoegema6390
@henkoegema6390 3 роки тому
:-)
@laptrinhdientu
@laptrinhdientu 2 роки тому
Thanks. Can you make a tutorial with window OS ♥
@michaelchu5423
@michaelchu5423 2 роки тому
I am new to code in C. I cannot run "sudo snap install cmake". How to install 'snap' first?
@duckyblender
@duckyblender Рік тому
sudo apt install snapd
@minhajsixbyte
@minhajsixbyte 7 місяців тому
Its not a C thing. Its a ubuntu thing.
@Qw3r3wQ
@Qw3r3wQ 2 роки тому
Mmmmm, tasty...
@LowLevelLearning
@LowLevelLearning 2 роки тому
😋
@Dylan-we5dz
@Dylan-we5dz 6 місяців тому
i think i bricked it :(
@raisagorbachov
@raisagorbachov Рік тому
A "little" more complicated... I decided to stick with Python on the Pi and C++ on the Arduino as a result of seeing that "little" extra complication.
@sledgex9
@sledgex9 2 роки тому
Some criticism: 1. Where's the C++ ? This is pure C. 2. Why instruct cmake (CMakeLists.txt) that your project uses C++ and ASM when in fact it only uses C? You don't need to set the C++ standard either if you don't use C. 3. Type safety! Why define GPIO_ON/GPIO_OFF as 1/0 instead of true/false? Match the API signature. 4. Let me post a C++ modification that also gets rid of using the preprocessor for the defines: #include namespace { //anonymous namespace, makes variables local to this translation unit. Same as defining them as static. constexpr bool GPIO_ON = true; constexpr bool GPIO_OFF = false; constexpr unsigned int LED_PIN = 25; } int main() { //blah }
@minhajsixbyte
@minhajsixbyte 7 місяців тому
thanks!
How do ethical hackers use Metasploit? ("Blog" / TryHackMe / Medium)
29:37
CTF_Walkthroughs with k4li$urf3r
Переглядів 131
The World's Fastest Cleaners
00:35
MrBeast
Переглядів 81 млн
i changed my mind about this language
9:34
Low Level Learning
Переглядів 92 тис.
Use BOTH Cores  |  Dual Core Programming on the Raspberry Pi Pico
7:49
Low Level Learning
Переглядів 37 тис.
Programming a Raspberry Pi Pico with C or C++
19:47
Gary Explains
Переглядів 102 тис.
the TRUTH about C++ (is it worth your time?)
3:17
Low Level Learning
Переглядів 554 тис.
Raspberry Pi Pico - C/C++ SDK Setup [macOS]
11:57
deltocode
Переглядів 4,3 тис.
Titus Reacts to Linus Tech Tips Linux Daily Drive Challenge
20:21
Chris Titus Tech
Переглядів 697 тис.
researchers find unfixable bug in apple computers
8:32
Low Level Learning
Переглядів 671 тис.
this is a warning to anyone using php
6:32
Low Level Learning
Переглядів 175 тис.
This Computer Costs $10
5:10
Austin Evans
Переглядів 3,5 млн
US Government declares the safest programming language
14:00
Low Level Learning
Переглядів 89 тис.