NeoPixelBus icon indicating copy to clipboard operation
NeoPixelBus copied to clipboard

Library does not compile when a ESP32-S3 board is selected in Arduino IDE

Open Miraculix200 opened this issue 2 years ago • 6 comments

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

Miraculix200 avatar Jun 11 '22 22:06 Miraculix200

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.

Makuna avatar Jun 11 '22 23:06 Makuna

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.

Miraculix200 avatar Jun 12 '22 09:06 Miraculix200

https://github.com/Makuna/NeoPixelBus/pull/580

Try it now.

Makuna avatar Jun 12 '22 20:06 Makuna

It compiles without errors and works. I'm using the NeoEsp32Rmt0800KbpsMethod though, not SPI.

Miraculix200 avatar Jun 13 '22 12:06 Miraculix200

I2s is tracked by https://github.com/Makuna/NeoPixelBus/issues/559, its currently not supported for C3 or S3.

Makuna avatar Jun 13 '22 16:06 Makuna

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.

Makuna avatar Jun 21 '22 00:06 Makuna

https://github.com/Makuna/NeoPixelBus/releases/tag/2.7.2

Makuna avatar Feb 03 '23 02:02 Makuna