Issue compiling dedic_gpio.c

adanpantoja
Posts: 3
Joined: Sat Mar 25, 2023 8:53 pm

Issue compiling dedic_gpio.c

Postby adanpantoja » Sat Mar 25, 2023 9:07 pm

Hello,

I am currently working on a project which requires me to bit-bang data to an external LED. I have been following Espressif documentation (https://docs.espressif.com/projects/esp ... _gpio.html) on how to use the dedicated GPIO feature to perform bit banging.

Unfortunately, I have run into a issue during compilation where the program has an undefined reference to 'dedic_gpio_new_bundle'. As you may already know, this means the program is not linking the dedic_gpio.c file into the main application. I traced down this file into the CMakeLists.txt located in the "frameworks\esp-idf-v5.0\components\driver" directory. I also noticed that this file is compiled only if CONFIG_SOC_DEDICATED_GPIO_SUPPORTED is set. I have looked at the menuconfig GUI to see if I can find this flag, but I could not find it.

So my question is, what do I have to do to get my program to compile the correct files so I can use the dedicated gpio feature? Do I need to enable CONFIG_SOC_DEDICATED_GPIO_SUPPORTED, and if so, how do I do this?

Thank you in advance! I really appreciate the help.

ESP_Sprite
Posts: 9746
Joined: Thu Nov 26, 2015 4:08 am

Re: Issue compiling dedic_gpio.c

Postby ESP_Sprite » Sun Mar 26, 2023 2:04 am

What chip are you using? Only later chips support this. Also note that dedic_gpio is usually used specifically for places where the APB bus latency (of a few 80MHz clock cycles) is too long; for blinking a LED, you probably want to use the normal GPIO API, which works on every ESP chip.

adanpantoja
Posts: 3
Joined: Sat Mar 25, 2023 8:53 pm

Re: Issue compiling dedic_gpio.c

Postby adanpantoja » Sun Mar 26, 2023 2:51 am

I am using the ESP32-WROVER-E from Freenove.

Also, I should have provided some more detail, but I am trying to interface with the WS2812B LED, so a regular GPIO will not work. This requires me to bit bang the data with the timing requirements shown in the attached image.

I did want to mention that I am writing my source code in C, and not using an Arduino IDE.
Attachments
ws2812b_data_timing.PNG
ws2812b_data_timing.PNG (13.89 KiB) Viewed 1386 times
ws2812b_data.PNG
ws2812b_data.PNG (17.17 KiB) Viewed 1386 times

ESP_Sprite
Posts: 9746
Joined: Thu Nov 26, 2015 4:08 am

Re: Issue compiling dedic_gpio.c

Postby ESP_Sprite » Mon Mar 27, 2023 12:34 am

Yeah, the ESP32 on that module does not support dedicated IO. However, that's actually not the best way to control those LEDs: the RMT, I2S and SPI peripherals have been used successfully for that in the past, and they don't require tight timing loops without interruptions. Here is one using the RMT that is used in our examples, for instance.

adanpantoja
Posts: 3
Joined: Sat Mar 25, 2023 8:53 pm

Re: Issue compiling dedic_gpio.c

Postby adanpantoja » Tue Mar 28, 2023 2:02 am

Ahh okay, that checks out why the source code isn't compiled in.

No way, I'm so pumped that you provided an example of how to interface with the WS2812 LEDs. I've been looking online for examples, but all methods have been done with the Arduino (pre-made library). I will attempt the example you have linked and see where that takes me.

Thank you for guiding me to the correct next step! I think I will mark this thread as resolved and create another post if I run into an issue.

Solution: ESP32 does not support dedicated GPIO; only newer chips do.

Who is online

Users browsing this forum: Baidu [Spider], BipinDangwal, ignisuti, MicroController and 110 guests