NeoPixelBus
NeoPixelBus copied to clipboard
Library does not compile when a ESP32-S3 board is selected in Arduino IDE
Library does not compile when a ESP32-S3 board is selected in Arduino IDE. Compilation fails with error:
DotStarEsp32DmaSpiMethod.h:41:52: error: 'VSPI_HOST' was not declared in this scope
DotStarEsp32DmaSpiMethod.h:41:52: note: suggested alternative: 'SPI3_HOST' const static spi_host_device_t SpiHostDevice = VSPI_HOST; ^~~~~~~~~ SPI3_HOST
This can be fixed by commenting out the line 115 in Neopixelbus.h:
#include "internal/DotStarEsp32DmaSpiMethod.h"
I guess some #if defined directives could be added. I think all ESP32-S3 boards include the compiler option -DARDUINO_VARIANT="esp32s3". But it's not possible to make the preprocessor compare the string? Another compilter option included for some boards is -DARDUINO_ESP32S3_DEV
DMA may also be possible on ESP32-S3, but I didn't test it: https://github.com/Bodmer/TFT_eSPI/issues/1863
If they follow their standards, it should be CONFIG_IDF_TARGET_ESP32S3
But, it takes more than what you suggest to fix this.
These defines control RMT channels also and there is needed research to known how many are supported as even if they only support two they may still define four as available in the code.
Datasheet says the ESP32-S3 supports 4 RX and 4 TX channels for RMT. DMA TX access on channel 3, RX access on channel 7. This RMT Neopixel example supposedly works with ESP32-S3 (I did not test it): https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino
And yes, CONFIG_IDF_TARGET_ESP32S3 should work. I forgot.
https://github.com/Makuna/NeoPixelBus/pull/580
Try it now.
It compiles without errors and works. I'm using the NeoEsp32Rmt0800KbpsMethod though, not SPI.
I2s is tracked by https://github.com/Makuna/NeoPixelBus/issues/559, its currently not supported for C3 or S3.
I am leaving this open until I create a released version that includes the changes. I marked it Pending, this means the github has the changes, but they haven't been officially released. Sort of wish I had a way for the author (you) to mark it as "I agree its fixed" without closing it.
https://github.com/Makuna/NeoPixelBus/releases/tag/2.7.2