Bare metal GPIO driver for ESP32 | Toggling an LED

preview_player
Показать описание
In this video, I write my own GPIO driver for the ESP32 microcontroller, instead of using the provided ESP-IDF headers. All memory addresses are pulled directly from the Technical Reference Manual.

[Technical Reference Manual]

[Source Code]
Рекомендации по теме
Комментарии
Автор

Man this was dope, explanation was great. Most people just blow right over stuff like this like its nothing.

turboimport
Автор

Holy crap that was simple. I just switched over the Espressif framework from Arduino and I've been messing around with their GPIO driver for a couple of hours now. Considering all I needed to do was toggle the internal LED, this saves so much hassle.

zaca
Автор

Very useful: thanks. Great for ULP programming where there's no other option.

tjwatts
Автор

Your videos are great!!!
Thanx a lot for your time and effort!!!

alexclarosfernandez
Автор

Nice video. Please note that GPIO_OUT_W1TS_REG and GPIO_OUT_W1TC_REG are exposed in soc/gpio_reg.h so a simple #include is sufficient, no need to define these registers inside your code. Please also note that GPIO pin numbers are exposed in hal/gpio_types.h. Same comment, no need to define GPIO5 macro again.

matsvandamme
Автор

Great stuff, arw you willing to continue the series? I am looking for a bate metal approach to the ESP32 instead of the typical arduino core use. What topics are you looking to cover?

fadieid
Автор

Can anyone give insight on how to read GPIO pin such as button and control LED foe ESP32.

aslambasha
Автор

man writing code like its native language

skanderbelhaj
Автор

If you using FreeRTOS, it’s not bare metal, right? 😂

msbanda
Автор

I tried reading the same document to see how you came about your awesome simplicity. What made you decide to avoid setting the GPIO_FUNCx_OUT_SEL register?

PatrioticGestalt
Автор

When this code is executed on ESP32, Is there some FreeRTOS tasks at under kernel ? I am trying to check a gpio from external source and send to serial, and the FreeRTOS under IDF sometimes run task like IPC and move the context of execution. I watched the video and I dont understand why you move to linux. Does it possible under windows create a Real Bare Bone code ? Thanks in Advance.

jeanfernandeseng
Автор

The moment you included the RTOS and linked against IDF's libraries, it's no longer bare metal. All you did was bypass the GPIO functions. What a waste if time.

bobweiram
Автор

The next step is write your own linker script

grenadier