From 9fd2a51cf4d058c643d0efadbcc7cfe1787904db Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 26 Mar 2026 18:09:35 +0100 Subject: [PATCH] fix for APA102 crash on classic esp32 with PSRAM On esp32 with PSRAM, one of the SPI hosts (HSPI or VSPI) will be occupied by the system. Application code should never touch this SPI host. --- wled00/bus_wrapper.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h index 41e7b39c..da274e66 100644 --- a/wled00/bus_wrapper.h +++ b/wled00/bus_wrapper.h @@ -263,11 +263,19 @@ bool canUseSerial(void); // WLEDMM (wled_serial.cpp) returns true if Serial ca #endif //APA102 -#ifdef WLED_USE_ETHERNET +#if defined(WLED_USE_ETHERNET) || (defined(BOARD_HAS_PSRAM) && defined(CONFIG_SPIRAM_OCCUPY_VSPI_HOST) && (defined(CONFIG_SPIRAM_TYPE_ESPPSRAM32) || defined(CONFIG_SPIRAM_TYPE_AUTO))) // fix for #2542 (by @BlackBird77) +// fix for esp32 with PSRAM: if SPI RAM is of type 32MBit, one of the SPI hosts (HSPI or VSPI) will be occupied by the system. Application code should never touch this SPI host. #define B_HS_DOT_3 NeoPixelBusLg //hardware HSPI (was DotStarEsp32DmaHspi5MhzMethod in NPB @ 2.6.9) +#warning "APA102 cannot use VSPI, falling back to HSPI" +#if CONFIG_SPIRAM_OCCUPY_HSPI_HOST +#warning "APA102 uses HSPI driver which might be needed for PSRAM" +#endif #else #define B_HS_DOT_3 NeoPixelBusLg //hardware VSPI +#if CONFIG_SPIRAM_OCCUPY_VSPI_HOST +#warning "APA102 uses VSPI driver which might be needed for PSRAM" +#endif #endif #define B_SS_DOT_3 NeoPixelBusLg //soft SPI