ESP32-C6: WS2812 Component Crash - RMT Driver/CAL Incompatibility with ESP-IDF v5.3

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
MJU20
Posts: 363
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 105 times
Been thanked: 74 times

Flowcode v10 ESP32-C6: WS2812 Component Crash - RMT Driver/CAL Incompatibility with ESP-IDF v5.3

Post by MJU20 »

Hi everyone,

I am encountering a critical issue with the WS2812 (LED_WS2811) component on the ESP32-C6 in FC10. While basic GPIO functions (like blinking a standard LED) work perfectly, the WS2812 component causes a system crash during initialization.

Environment:
  • Target: ESP32-C6
  • Toolchain: Flowcode V10 / ESP-IDF v5.3
  • Hardware: ESP32-C6 DevKit (WS2812 on GPIO 8)
The Issue: During runtime, the chip aborts with an ESP_ERR_INVALID_ARG error. Investigation shows that the RMT driver is being passed a completely wrong GPIO pin (reported as 538 in the log): E (346) rmt(legacy): rmt_set_gpio(538): RMT GPIO ERROR

My findings so far: I have investigated the generated C-code and the CAL files, and it seems there is a fundamental mismatch between the Flowcode CAL layer and the current ESP-IDF requirements for the C6:

Hardcoding the Pin: I attempted to bypass the "538" pin error by hardcoding config.gpio_num = 8; in ESP_CAL_RMT.c. This stopped the crash, but the LED does not light up and the program hangs.

Driver Mismatch: When I tried to add modern RMT configuration members like config.clk_src or config.flags.with_dma, the compiler (v5.3) returned errors stating that these members do not exist in the structure: error: 'rmt_config_t' has no member named 'clk_src'

Legacy vs. New Driver: The error logs mention rmt(legacy). It appears that for the ESP32-C6, the ESP-IDF requires the new RMT driver model, but the Flowcode CAL file (ESP_CAL_RMT.c) is still using the legacy structure which is incompatible or incorrectly mapped for the RISC-V based C6.

Strange Defines: I also noticed that the generated code for the WS2811 component contains STM32-style register defines (MODER, BSRR), which suggests a fallback to an incorrect architecture's macro definitions.

Conclusion: It seems the RMT/WS2812 CAL needs an update to be fully compatible with the ESP32-C6 and the newer ESP-IDF versions it relies on.

Has anyone else successfully used RMT-based components on the C6, or is there a patch available for the ESP_CAL_RMT.c file?

Note: I would like to mention that I was guided through these technical findings by Gemini (AI). This summary and the analysis of the compiler errors were also co-authored with AI to ensure all technical details were captured correctly. It’s been a great help in pinpointing what seems to be a CAL/IDF version mismatch.

mnfisher
Valued Contributor
Posts: 1771
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 148 times
Been thanked: 835 times

Re: ESP32-C6: WS2812 Component Crash - RMT Driver/CAL Incompatibility with ESP-IDF v5.3

Post by mnfisher »

I've hit this problem before - I've got round it once by using the new RMT code (which i haven't found) and once by using the SPI hardware viewtopic.php?t=2538&hilit=Ws2812+leds+spi - hopefully this still works, but there have been lots of changes in the espressif tools 😕

Martin

mnfisher
Valued Contributor
Posts: 1771
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 148 times
Been thanked: 835 times

Re: ESP32-C6: WS2812 Component Crash - RMT Driver/CAL Incompatibility with ESP-IDF v5.3

Post by mnfisher »

The (rough) code using the newer RMT incarnation is at https://www.flowcode.co.uk/forums/viewt ... 096#p20096

Martin

MJU20
Posts: 363
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 105 times
Been thanked: 74 times

Re: ESP32-C6: WS2812 Component Crash - RMT Driver/CAL Incompatibility with ESP-IDF v5.3

Post by MJU20 »

I replaced the content of ESP_CAL_RMT.c with a version where I hardcoded the GPIO to 8 and removed the ESP_ERROR_CHECK on the configuration. The LED is now working perfectly! This confirms the issue is purely in the Flowcode pin mapping and the way the RMT struct is handled for the C6.

My version of the ESP_CAL_RMT.c for the ESP32-C6 Dev Board is attached with the WS2812B as the onboard LED on PIN 8..
Attachments
ESP_CAL_RMT.c
(3.85 KiB) Downloaded 4 times

Post Reply