Getting Started with the ESP32 Development Board | Programming an ESP32 in C/C++

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ค. 2024
  • In this video, we explore how to setup the Espressif IOT Development Framework, or IDF, and use it to write C code to blink an LED on the board. We discuss FreeRTOS, the operating system being ran on the ESP32, and how to write code that uses the RTOS and ESP32 API's to get GPIO working. We also discuss logging data to the serial bus, and using the monitor to view the serial output.
    The ESP32 IDF uses FreeRTOS, an open source real time operating system that is used on smaller embedded boards. FreeRTOS allows you to make tasks for different features on your board. Pairing this with the IDF allows you to write powerful Wifi programs to the ESP32.
    Check out my new merch store!: lowlevellearning.myspreadshop...
    Chapters
    0:00 Intro
    0:16 Getting Started
    2:18 Using IDF
    2:51 A New Project
    3:47 Building a Blank Project
    4:50 Writing ESP32 FreeRTOS Code
    7:18 Flashing the ESP32
    8:16 A Bug You Say???
    9:50 GPIO Output
    13:25 A Bug, REDUX?
    15:15 Outro
    Join me on Discord!: / discord

ความคิดเห็น • 106

  • @LowLevelLearning
    @LowLevelLearning  2 ปีที่แล้ว +18

    How has your experience been with the ESP32 IDF? Let me know!

    • @colanuss4985
      @colanuss4985 2 ปีที่แล้ว +1

      Not so well when trying to split the program into multiple components and driver .c files.. makefile compilation is a mess

    • @larrybud
      @larrybud 2 ปีที่แล้ว +4

      @@colanuss4985 Use a proper IDE, like VSCode.

    • @svenprigann2631
      @svenprigann2631 2 ปีที่แล้ว +2

      Never saw somebody actually using idf. Seems like the esp32 is targeted to the maker scene. That's why nobody cares about a proper build toolchain.
      For me personally, I just looking into wifi and stuff via microphython for testing a small webserver.
      The ESP boards got far to less pins and peripherals to be used in industry (my opinion)
      No external bus controller, no DSi/LCD controller/no sophisticated timer peripheral and such
      Far, far to less communication peripherals.
      What's your opinion?

    • @mayursj3175
      @mayursj3175 8 หลายเดือนก่อน

      How to solve this error ERROR: MSys/Mingw is not supported. Please follow the getting started guide of the documentation to set up a supported environment. I am trying to run this command in Git Bash using Windows I am struct can somebody help me

    • @mayursj3175
      @mayursj3175 8 หลายเดือนก่อน

      I was able to resolve that error by using .bat files instead of .sh file in Command prompt for Windows if you want to program using windows use .bat files

  • @toplist2613
    @toplist2613 2 ปีที่แล้ว +77

    I appreciate you showing the errors and how you work through them. I feel like that’s a important piece that most people cut out.

    • @oshosanyamichael9589
      @oshosanyamichael9589 9 หลายเดือนก่อน +1

      Very important piece. Some others just produce flawless code on first try.

  • @reezuleanu1676
    @reezuleanu1676 หลายเดือนก่อน

    You have no idea how hard it is to find a guide on how to flash your program without using an IDE. Thank you my friend

  • @mt-qc2qh
    @mt-qc2qh ปีที่แล้ว +4

    Great lesson on the IDF. Personally, I use many different modules, including the whole family of esp's, nrf and avr processors, so I enjoy the consistency of using the Arduino IDE. This IDE is simple and fast enough for switching mindsets on the various modules. With this I've programmed hundreds of IOT projects over the years and enjoy any instruction on alternate environments.
    Your videos are some of the best. Thank you.

  • @DonQuichotteLiberia
    @DonQuichotteLiberia 2 ปีที่แล้ว

    Thank you! Your tutorials are very concise and the explanations are clear and straightforward. And i3wm is beautiful!

  • @aissamma3623
    @aissamma3623 4 หลายเดือนก่อน

    awesome tutorial, especially the walkthrough of solving errors, thank you so much

  • @mozartantonio1919
    @mozartantonio1919 22 วันที่ผ่านมา

    SUUUUPER good video for real. It has everithing right. Good audio and video, the image of the board being plugged and pushing the reset button. Congrats!

  • @MpSniperM1911
    @MpSniperM1911 29 วันที่ผ่านมา

    Now I understand why this tutorial was so useful and on point, LowLevelLearning did it! I just started watching the first video that popped up without realizing and good for me I will get everything running like it should

  • @federicojoaquincoronati8353
    @federicojoaquincoronati8353 2 ปีที่แล้ว

    Thanks a lot, this is very helpful. Getting started in this projects it's hard at first

  • @denbeibaron7797
    @denbeibaron7797 2 ปีที่แล้ว +3

    I subscribed!!!
    This has saved me a ton of time reading those ebooks.
    Super awesome content.

  • @prashkd7684
    @prashkd7684 2 ปีที่แล้ว

    Great video. Waiting for part 2

  • @liquid2499
    @liquid2499 2 ปีที่แล้ว +3

    Neat. I’d been meaning to check out ESP-IDF. Thanks. Awesome video as always.

  • @alol-alol
    @alol-alol 2 ปีที่แล้ว +6

    Cool video! The ESP32’s dev environment looks like it avoids a lot of headaches and boilerplate in getting things set up. Looking forward to other videos in the series!

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว +2

      Thanks for watching!
      Its definitely more complicated than the Pi Pico or Arduino, but its also way more power.

    • @Grivious20
      @Grivious20 2 ปีที่แล้ว +1

      Esp32 provides us with 2 cores which is great but in the mean time, it has relatively high latency due to the external flash that is on the board. It's great platform from IOT perspective, but not the fast one as in compare with stm32 family ucs

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว +4

      @@Grivious20 thats a great point. maybe I'll do a speed test some day between the ESP32 and the STM family.

    • @Grivious20
      @Grivious20 2 ปีที่แล้ว

      @@LowLevelLearning that would be awesome !

  • @daniruiz2572
    @daniruiz2572 2 ปีที่แล้ว +1

    Just what I was looking for. incredibly well explained video. My congratulations

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว

      Awesome, thank you!

    • @daniruiz2572
      @daniruiz2572 2 ปีที่แล้ว

      @@LowLevelLearning waiting for another new video. I encourage you to do more. Thank you so much

  • @victormikecharlie1596
    @victormikecharlie1596 2 ปีที่แล้ว

    We need more videos about it, low level idf programming esp32 please
    Thank you for your great work

  • @thisisreallyme3130
    @thisisreallyme3130 5 หลายเดือนก่อน

    Just learning ESP32 IDF now after YEARS of Arduino and CircuitPython. I love this chip... so powerful and so inexpensive... it's got everything for less cost than the batteries you might purchase for it! :-D TY for this series of videos! I'm also planning to take your Udemy course.
    Please consider grouping some of your ESP32 videos into a Playlist, but I was able to find everything under the Videos tab. Cheers.

  • @leahlee8535
    @leahlee8535 ปีที่แล้ว

    Thank you Thank you Thank youuuuuuuu This was a good tutorial. Loved seeing the mistakes so that I can fix my own!!

  • @Tutorius
    @Tutorius 3 หลายเดือนก่อน

    Thank you for this tutorial!
    I have done some programming for the last weeks using the Arduino-IDE and my Chinese ESP-WROOM-Board. Everything worked well, but i wanted to try to program directly in IDF cause i get an Audio-ESP in some days, and want to try to get this running as a synthesizer.
    So i startet to get the VSCode to run with IDF, and it did not work. I know VS-Code, i use it to create the firmware for my 3D-printer, and the Porject-management is totaly crap.
    So your tutorial to get the IDF running on my arch-linux worked very well.
    I do videos about 3D-printing and desigent, and i often also do trying, create errors and talk these errors to the viewers. Many like it to see what the process of design is, but some "need" videos that are without any errors, look like all is nice and easy.

  • @hewiweng99
    @hewiweng99 2 ปีที่แล้ว

    Thanks! You helped me a lot!

  • @gerdsfargen6687
    @gerdsfargen6687 ปีที่แล้ว

    I find Eclipse IDF is just fine for building and configuring the project, even when splitting out to separate header files and such. FreeRTOS is the way to go.

  • @seanburnett7760
    @seanburnett7760 ปีที่แล้ว

    Great tutorial. Thanks!

  • @esp32
    @esp32 2 ปีที่แล้ว

    Great video, great name of channel and great teacher

  • @lunarlabour7012
    @lunarlabour7012 2 ปีที่แล้ว

    Very high quality content

  • @jorgeluis4389
    @jorgeluis4389 11 หลายเดือนก่อน

    Excellent tutorial. The errors make it real!

  • @veli-pekkaporrassalmi3135
    @veli-pekkaporrassalmi3135 2 ปีที่แล้ว +7

    I've been looking forward to start learning the ESP-IDF instead of using the Arduino integration (for fun and learning purposes). However I've always postponed that since I'm way too used to the Arduino platform. Currently I'm working with a project based on ESP32 and this morning I decided that I'm gonna learn the ESP-IDF and use that for this project. I was just casually scrolling on TH-cam and happened to notice your new video about... well.. getting started with the ESP32 IDF! Haha, what are the odds of that! Anyway, great video! This did get me started.

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว +1

      I'm very happy to hear this was useful!

    • @suhaschitra3965
      @suhaschitra3965 2 ปีที่แล้ว

      Me too

    • @yassinezouari9338
      @yassinezouari9338 11 หลายเดือนก่อน

      what is you think about the experience worth the time?

  • @rmwright70
    @rmwright70 2 ปีที่แล้ว

    Good Video. Learned a few things.

  • @mrkewi1
    @mrkewi1 3 หลายเดือนก่อน

    love your channel. thanks!

  • @ostanin_vadym
    @ostanin_vadym 2 ปีที่แล้ว

    Thanks for the content

  • @ironman5034
    @ironman5034 2 ปีที่แล้ว

    Do more with the esp32 it's pretty powerful

  • @alexxx4233
    @alexxx4233 2 ปีที่แล้ว

    Nice tutorial !!!!

  • @dominikz5776
    @dominikz5776 9 หลายเดือนก่อน

    Do u use Visual Studio and integrate the ESP IDF extension or what kind of IDE is this?

  • @jamixxbot1724
    @jamixxbot1724 ปีที่แล้ว

    A really good tutorial 🔥

  • @TOMTOM-nh3nl
    @TOMTOM-nh3nl 2 ปีที่แล้ว

    Thank You

  • @danielgrafflin9689
    @danielgrafflin9689 3 หลายเดือนก่อน

    Great tutorial for the nubie. What to do when things go wrong and fixing errors is all too important.

  • @microcontrolprojects
    @microcontrolprojects ปีที่แล้ว

    King, you know this business. Everyone can know but cannot teach, you teach.

    • @gerdsfargen6687
      @gerdsfargen6687 ปีที่แล้ว

      yes pretty much like all the malakes that want to correct this dude but wont offer up their own videos. That much is true,

  • @barchilsaid3001
    @barchilsaid3001 2 ปีที่แล้ว

    Thank you. :)

  • @rul1175
    @rul1175 7 หลายเดือนก่อน

    What is the editor you are using in the video????

  • @scott6932
    @scott6932 10 หลายเดือนก่อน +1

    The new Tamgotchi Uni uses a ESP32-S3-WROOM-1! kinda cool!

  • @divencia
    @divencia ปีที่แล้ว +1

    What compiler do you use for programming?

  • @Mohamed-kr8jt
    @Mohamed-kr8jt ปีที่แล้ว

    nice video, it was very useful
    can you explain how to control GPIO using register addresses
    I have try to look in the datasheet but I can't understand anything

  • @bennguyen1313
    @bennguyen1313 ปีที่แล้ว

    At the 8m mark, why do you press the boot button after it was programmed (idf py flash )? You mention that you are holding the boot button for it to catch after using idf py monitor... then the monitor shows waiting for download.
    After the flashing step, could you have just hit the reset button in order to run the program?
    And if you have your ESP-32 connected to a JTAG debugger.. does that flash the board every time you debug, or does it download it (to RAM) without flashing?

  • @MakeTeachRepeat
    @MakeTeachRepeat 2 ปีที่แล้ว

    Your voice is a lot like Adafruits - if you boost mid-frequencies in audio - very, very nice presentation style and voice. Good content - keep it up! I'm learning a lot.

  • @donnellboles1149
    @donnellboles1149 2 ปีที่แล้ว

    Hello, can you program the ESP32 to read data from 4 accelerometers?

  • @getyourphils3334
    @getyourphils3334 2 ปีที่แล้ว +1

    Any chance you're working on the wifi tutorial you mentioned? Love the videos.

  • @norlesh
    @norlesh 22 วันที่ผ่านมา

    I tuned in on this clip explicitly because of the C++ in the title; alas its the same old embedded C.

  • @dominikz5776
    @dominikz5776 9 หลายเดือนก่อน

    Is this the git shell?

  • @peterpiper8806
    @peterpiper8806 ปีที่แล้ว

    I'm a little slow here, kindly help, which command line an I copying the link into? Or rather what ide is being used?

  • @kavorka8855
    @kavorka8855 11 หลายเดือนก่อน

    An STM32 blue or black board with a bluetooth/wife module may be better since you could use the sm32's powerful IDE.

  • @user-qi6jl5ox1h
    @user-qi6jl5ox1h 8 หลายเดือนก่อน

    How to solve this error ERROR: MSys/Mingw is not supported. Please follow the getting started guide of the documentation to set up a supported environment. I am trying to run this command in Git Bash using Windows I am struct can somebody help me.

  • @JFM1170
    @JFM1170 5 หลายเดือนก่อน

    Worked good up to build at about 4:11 then the CMake error

    • @JoaoVictor-xi7nh
      @JoaoVictor-xi7nh 2 หลายเดือนก่อน

      Were you able to solve it?

    • @JFM1170
      @JFM1170 2 หลายเดือนก่อน

      @@JoaoVictor-xi7nhIt's been a while but no I never got it to work. The ESP32 just sits I have never been able to program it. I have tried in Linux and Windows with the Arduino software never been able to write to the device.

  • @BabyZoomer278
    @BabyZoomer278 หลายเดือนก่อน

    Am I missing something? There doesn't seem to be any discussion of programming the ESP32 with C++, even though the title suggests this.

  • @Eiarlk
    @Eiarlk 16 วันที่ผ่านมา

    What of i need to use another operating system apart from C and C++

  • @lm2668
    @lm2668 2 ปีที่แล้ว +3

    Can you do more arm assembly video pls?

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว

      What topic specifically are you interested in?

  • @Numb3r1
    @Numb3r1 2 ปีที่แล้ว +1

    Are you going to do more videos on esp-idf in the future?

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว +1

      Sure will!

    • @Numb3r1
      @Numb3r1 2 ปีที่แล้ว

      @@LowLevelLearning Awesome! Looking forward to it.

  • @roughedge-machineworks
    @roughedge-machineworks 2 ปีที่แล้ว +2

    Rust on ESP32?? :)

  • @sklearn9391
    @sklearn9391 2 ปีที่แล้ว

    Sir I have installed the framework but got the following error after running command idf.py build
    gen_crt_bundle.py: Invalid certificate in /home/santa/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem
    Invalid certificate

  • @rahim9568
    @rahim9568 10 หลายเดือนก่อน

    Thank you, but this is a hard task, arduion is one hander time better faster and easier.
    I use it only for wifi with its default factory software and communicate with it via UART.

  • @sahar87918
    @sahar87918 2 ปีที่แล้ว

    I am using esp32-CAM and when I get to the waiting to the download part where i'm supposed to hit the reset button (min 8:15 ) I keep getting the same message (waiting to download..) , anyone has an idea?

  • @climbeverest
    @climbeverest 7 หลายเดือนก่อน

    Wait a second, did that board have rtos already running or you compiled rtos and your program? You should explain that

    • @AdityaSharma-co6st
      @AdityaSharma-co6st 5 หลายเดือนก่อน

      The whole kernel will be built along with the application. So the whole RTOS was compiled (everytime).

  • @jeffreydijkstra3391
    @jeffreydijkstra3391 2 ปีที่แล้ว

    is there a windows version? because i cant execute the commands

  • @wenbiaozhao4634
    @wenbiaozhao4634 2 ปีที่แล้ว +1

    I have finish till the building ,but when i flash, system told me a fatal error occurred: MD5 of file doesn't match data in flash, but this board i flash i arduino IDE no any problem.file md5 and flash md5 not equal

    • @wenbiaozhao4634
      @wenbiaozhao4634 2 ปีที่แล้ว

      I just follow you step by step, but who can tell me what's wrong with me,thanks

  • @ofirgaash
    @ofirgaash ปีที่แล้ว

    0:30
    where is my command line?
    CMD?

  • @shivanshuraj7175
    @shivanshuraj7175 6 หลายเดือนก่อน

    i get error failled to determine sizeof(time_t)

  • @tinayoga8844
    @tinayoga8844 2 ปีที่แล้ว +1

    Do these instructions work for Windows?

    • @LowLevelLearning
      @LowLevelLearning  2 ปีที่แล้ว

      Assuming you have cmake installed on Windows I think the build commands should be largely the same. The IDF commands should be exactly the same too.

  • @vebbis5961
    @vebbis5961 ปีที่แล้ว

    Awesome. This was way better than using the shitty vscode extension

  • @cadsonmikael9119
    @cadsonmikael9119 2 ปีที่แล้ว

    Nice tutorial. However from my point of view the Arduino setup is 10 times faster and easier to use. Especially if you try to use and edit the IDF samples with WiFi or BLE. It is just not worth the hassle. The code is just all over. For simple things though, where the wireless stacks are not used, it is really powerful and one get full controll over i/o:s and can speed up the process alot, compared to all the slow arduino layers of mambo. However, that really is not really the purpose with this module.

  • @AlessioSangalli
    @AlessioSangalli 2 ปีที่แล้ว +1

    Wow 16MB/s download, what kind of Internet do You have? I'm lucky if I get 3MB/s

  • @ashwini5775
    @ashwini5775 2 ปีที่แล้ว

    It's showing me cmake err, can you help me out with this

  • @ORIofficialchannel
    @ORIofficialchannel ปีที่แล้ว

    windows version?

  • @imim3772
    @imim3772 2 ปีที่แล้ว

    I've been using Arduino ide, looks the same

  • @serggorod1423
    @serggorod1423 ปีที่แล้ว

    7:01 настройкалогеров. How to fix.

  • @drjoriv
    @drjoriv 2 ปีที่แล้ว +1

    I guess he forgot to release part 2 haha

  • @dwhughes1975
    @dwhughes1975 10 หลายเดือนก่อน +1

    That was a fairly good instruction, but I have a critique. Personally my learning style is to follow these tutorials by pausing every few seconds and following everything that's going on, then jumping around and playing a bit with what the instructor's showing me, then resuming the video. That is NOT easy when you, the teacher, are doing things like entering a broken #include and then only correcting it much later in the video. Okay, I learned something by going and solving the problem myself and then continuing, but that's fighting the tutorial rather than following it. Troubleshooting is a necessary skill but this isn't a troubleshooting tutorial, it's a getting-started and GPIO tutorial, and I think you should be providing students with reliable information in a progressive and incremental way, rather then introducing false facts and then backtracking all over the place to undo them.

  • @Dennis12869
    @Dennis12869 12 วันที่ผ่านมา

    Tried to install it on Windows. No fun at all...

  • @MrPeloseco
    @MrPeloseco ปีที่แล้ว +1

    I bet when nobody sees you, you still use Arduino IDE 😜

  • @i_want_pizza7576
    @i_want_pizza7576 2 หลายเดือนก่อน

    6:17 why are you so bad at typing?

  • @Aliye727
    @Aliye727 2 ปีที่แล้ว

    hi in my file cant find include freertos.h why that happen thanks much