Open
Description
Describe the bug
With some cores, such as esp32s3
(for the Espressif ESP32-S3 dev board), simply referencing a default-method NeoPixelBus in the code (not necessarily actually using it!) causes a boot loop with an error message like this
ELF file SHA256: d2dd9a167d544b2f
Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40378489
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0x508
load:0x403c9700,len:0x4
load:0x403c9704,len:0xad0
load:0x403cc700,len:0x29e4
entry 0x403c9880
E (98) rmt(legacy): CONFLICT! driver_ng is not allowed to be used with the legacy driver
abort() was called at PC 0x4200f903 on core 0
Backtrace: 0x40377e76:0x3fceb200 0x4037c8a5:0x3fceb220 0x4038241d:0x3fceb240 0x4200f903:0x3fceb2c0 0x4201354a:0x3fceb2e0 0x4037817b:0x3fceb310 0x403cd852:0x3fceb340 0x403cdafe:0x3fceb380 0x403c98d5:0x3fceb4b0 0x40045c01:0x3fceb570 0x40043ab6:0x3fceb6f0 0x40034c45:0x3fceb710
To Reproduce
Steps to reproduce the behavior:
- Create a simple sketch using
NeoWs2812xMethod
- Add https://espressif.github.io/arduino-esp32/package_esp32_index.json to "additional board manager URLs"
- Select the "ESP32S3 Dev Module" board
- Compile, upload, run
Expected behavior
Sketch runs as usual.
Development environment (please complete the following information):
- OS: Ubuntu 24.04 LTS
- Build Environment - arduino-cli 1.0.2
- Board target - ESP32-S3
- Library version - 2.8.0
Additional context
I believe this is why this happens:
- on ESP32-S3 (and ESP32 in general) NeoPixelBus uses the RMT peripheral by default, via the "legacy" RMT driver from ESP-IDF (see ESP-IDF documentation)
- ESP-IDF will abort on startup if both "legacy" and "next gen" RMT drivers are even linked into the firmware (not necessarily used)
https://github.com/espressif/esp-idf/blob/5ca9f2a49aaabbfaf726da1cc3597c0edb3c4d37/components/driver/deprecated/rmt_legacy.c#L1405 - the ESP32 Arduino core has its own
neopixelWrite()
function which much like NeoPixelBus uses the RMT peripheral, using the "next gen" API
https://github.com/espressif/arduino-esp32/blob/614c72b4d3e9fd04dcccfe313bb2353b3b0eea46/cores/esp32/esp32-hal-rgb-led.c#L5 - if the
RGB_BUILTIN
macro is defined,digitalWrite()
will actually callneopixelWrite()
if that pin is written
https://github.com/espressif/arduino-esp32/blob/614c72b4d3e9fd04dcccfe313bb2353b3b0eea46/cores/esp32/esp32-hal-gpio.c#L169 - since any script is likely to pull in things like
digitalWrite()
directly or indirectly, that means ifRGB_BUILTIN
is defined, you end up linking inneopixelWrite()
and thus the "next gen" RMT driver, and if you're using NeoPixelBus you're also pulling in the "legacy" RMT driver, so that explodes - various board definitions (such as the dev board mentioned above) do define that symbol, thus causing this problem