Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't compile on esp-idf 5.3 #181

Open
juanpgg-git opened this issue Nov 20, 2024 · 5 comments
Open

doesn't compile on esp-idf 5.3 #181

juanpgg-git opened this issue Nov 20, 2024 · 5 comments

Comments

@juanpgg-git
Copy link

C:/Users/juanp/OneDrive/Documentos/Digital-dots/firmware-lights/components/esp_dmx/src/dmx/hal/uart.c: In function 'dmx_uart_init': C:/Users/juanp/OneDrive/Documentos/Digital-dots/firmware-lights/components/esp_dmx/src/dmx/hal/uart.c:330:51: error: 'uart_signal_conn_t' has no member named 'module' 330 | periph_module_enable(uart_periph_signal[dmx_num].module); | ^ C:/Users/juanp/OneDrive/Documentos/Digital-dots/firmware-lights/components/esp_dmx/src/dmx/hal/uart.c:338:52: error: 'uart_signal_conn_t' has no member named 'module' 338 | periph_module_reset(uart_periph_signal[dmx_num].module); | ^ C:/Users/juanp/OneDrive/Documentos/Digital-dots/firmware-lights/components/esp_dmx/src/dmx/hal/uart.c: In function 'dmx_uart_deinit': C:/Users/juanp/OneDrive/Documentos/Digital-dots/firmware-lights/components/esp_dmx/src/dmx/hal/uart.c:384:56: error: 'uart_signal_conn_t' has no member named 'module' 384 | periph_module_disable(uart_periph_signal[uart->num].module);

@tresler
Copy link

tresler commented Nov 28, 2024

Yes, in IDF 5.3 structure uart_signal_conn_t now don't have member "module". Have only IRQ and pins:
IDF 5.3 vs IDF 5.1

@b-destoop
Copy link

It looks like this is a bug on the ESP-IDF side.

esp_dmx/src/dmx/hal/uart.c refers to uart_periph.h and expects to find a definition of uart_signal_conn_t that contains a 'module' member. Except it does not exist in the version of uart_periph.h as given.

uart_periph.h is both found in
/esp-idf/components/soc/include/soc/uart_periph.h
and in
/home/bert/esp/esp-idf/components/soc/esp32/uart_periph.c
The second version contains the right definition of uart_signal_conn_t as expected, but is included for the compiler AFTER the first version, so the wrong content is selected.

Up until commit dca7c286d009024d8bacab52425c93a91ffc49c7, the version that was in /components/soc/include/soc/uart_periph.h did contain the expected definition, but was removed. Commit found here

@tresler
Copy link

tresler commented Jan 28, 2025

I found this fork and use #define macro for IDF version and everything work fine on ESP32-c6 with arduino-esp32 version 3.1.1. Only change .txt to .c

uart.txt

@gunstr
Copy link

gunstr commented Jan 28, 2025

@tresler good catch, I also had to go back to the esp-idf 5.1 version because of this. I have implemented the same changes in this branch but conditionally only for v.5.3 and higher. I also left out the format changes so it's easier to see what has actually happened.

I have not read up on the actual changes in the esp-idf why I have no real opinion on the correctness or completeness of the fix but I have tested with esp-idf v5.1.4 and v5.3.2 on an ESP32-S3 board and it works fine. Big thanks to @davispolito for your input.

@someweisguy let me know if you want a PR on this fix. Maybe someone can help with validation on more boards?

@gunstr
Copy link

gunstr commented Feb 6, 2025

Just realized that @davispolito already has subitted a PR (#187) with his changes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants