Skip to content

Commit 378edd1

Browse files
committed
ESP-IDF v5.4.1, FASTLED_USES_ESP32S3_I2S, Variants regroup
Warning: esp32-dev / esp32-wrover / c3-supermini: Replaced partitioning by no OTA because flash > 100% other partitioning (no ota?) or Tasmota platform needed Server ===== - pio.ini: upgrade to ESP-IDF v5.4.1 / Arduino v3.2.0 , change color order for WS2812B (WIP!) - Version: regroup per board, FASTLED_USES_ESP32S3_I2S on S3 boards - Mods: Physical driver: switch of for S3
1 parent 0f35d8c commit 378edd1

19 files changed

Lines changed: 287 additions & 257 deletions

boards/ESP32_4MB.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ nvs, data, nvs, 0x9000, 0x5000
33
otadata, data, ota, 0xe000, 0x2000
44
app0, app, ota_0, 0x010000, 0x300000
55
spiffs, data, spiffs, 0x310000, 0x0D0000
6-
coredump, data, coredump,,64K
6+
coredump, data, coredump,,64K
7+
#ESP32_4MB no OTA!!

lib/framework/SystemStatus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#elif CONFIG_IDF_TARGET_ESP32C6
3434
#include "esp32c6/rom/rtc.h"
3535
#define ESP_PLATFORM "ESP32-C6";
36-
#elif CONFIG_IDF_TARGET_ESP32P4
36+
#elif CONFIG_IDF_TARGET_ESP32P4 // 🌙
3737
#include "esp32p4/rom/rtc.h"
3838
#define ESP_PLATFORM "ESP32-P4";
3939
#else

platformio.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ extra_configs =
3333
framework = arduino ;espidf will not work as libs rely on arduino (e.g. PhysicHTTP, ...)
3434
; https://github.com/platformio/platform-espressif32/releases
3535
; platform = espressif32 @ 6.10.0 ;Jan 2025, ESP-IDF v4.4.7-dirty / Arduino v2.0.17
36-
platform = espressif32 @ 6.11.0 ; June 2025, ESP-IDF v4.4.7-dirty / Arduino v2.0.17 latest v4.4.7-dirty ! framework-arduinoespressif32 @ ~3.20017.0
36+
; platform = espressif32 @ 6.11.0 ; June 2025, ESP-IDF v4.4.7-dirty / Arduino v2.0.17 latest v4.4.7-dirty ! framework-arduinoespressif32 @ ~3.20017.0
3737
; v4 -> v5 flash size from 1955 to 2238 KB on S3 ! esp32 > 100%...
3838
; v5 resulting in FastLED hickups on all listed versions:
3939
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/2024.07.00/platform-espressif32.zip ; Jul 15, 2024 espressif Arduino core 3.0.2 / IDF 5.1.4: error: no matching function for call to 'NetworkClientSecure::setCACertBundle(const uint8_t [], int)'
4040
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.10/platform-espressif32.zip ; Dec 16, 2024 Arduino core 3.1.0 based on IDF 5.3.2.241210
4141
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip ; Jan 19, 2025 Arduino core 3.1.1 based on IDF 5.3.2.241224
4242
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip ; March 28, 2025 Latest release! ESP-IDF v5.4.1-1-g2f7dcd862a-dirty / Arduino v3.2.0
4343
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip ; June 2025 not 54.03? used in latest upstream ESP-IDF v5.3.2-584-g489d7a2b3a-dirty / Arduino v3.1.3
44+
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip ; see https://github.com/FastLED/FastLED/issues/1903 ESP-IDF v5.4.1-1-g2f7dcd862a-dirty / Arduino v3.2.0
4445

4546
;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
4647
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.06.02/platform-espressif32.zip ;; Tasmota Arduino Core 2.0.9 with IPv6 support, based on IDF 4.4.4
@@ -123,7 +124,7 @@ build_flags =
123124
-D ML_CHIPSET=WS2812B ; RGB, for fairy lights or https://www.waveshare.com/wiki/ESP32-S3-Matrix
124125
; -D ML_CHIPSET=APA106 ; for Cube202020 / some fairy curtain strings do not work with WS2812B
125126
; -D ML_CHIPSET=SK6812 ; WIP
126-
-D ML_COLOR_ORDER=GRB ; define your color order here if needed (why WS2812 has GRB instead of RGB?) Only for FastLED, PD software configurable
127+
-D ML_COLOR_ORDER=GBR ; define your color order here if needed (why WS2812 has GRB instead of RGB?) Only for FastLED, PD software configurable
127128
; -D ML_RGBW=1 ; define whether to enable RGBW (1 = yes, 0 = no) ... could be derived from ML_CHIPSET???
128129
; tests to resolve flicker in IDF 5...
129130
; -D FASTLED_RMT_BUILTIN_DRIVER=true

src/MoonLight/Mods.cpp

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,14 @@ void ArtNetDriverMod::loop() {
399399
void HUB75DriverMod::loop() {
400400
}
401401

402-
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2
403-
#include "I2SClockLessLedDriveresp32s3.h"
404-
static I2SClocklessLedDriveresp32S3 driverP; // sizeof(driver) = 1080K !
405-
#elif CONFIG_IDF_TARGET_ESP32
406-
#include "I2SClocklessLedDriver.h"
407-
static I2SClocklessLedDriver driverP;
402+
#if HP_PHYSICAL_DRIVER_S3
403+
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2
404+
#include "I2SClockLessLedDriveresp32s3.h"
405+
static I2SClocklessLedDriveresp32S3 driverP; // sizeof(driver) = 1080K !
406+
#elif CONFIG_IDF_TARGET_ESP32
407+
#include "I2SClocklessLedDriver.h"
408+
static I2SClocklessLedDriver driverP;
409+
#endif
408410
#endif
409411

410412
void PhysicalDriverMod::setup() {
@@ -430,49 +432,51 @@ void ArtNetDriverMod::loop() {
430432
initDone = true;
431433
ESP_LOGD(TAG, "sortedPins #:%d", layerV->layerP->sortedPins.size());
432434

433-
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32
434-
int pins[NUMSTRIPS]; //max 16 pins
435-
int lengths[NUMSTRIPS];
436-
int nb_pins=0;
437-
438-
for (const SortedPin &sortedPin : layerV->layerP->sortedPins) {
439-
ESP_LOGD(TAG, "sortedPin s:%d #:%d p:%d", sortedPin.startLed, sortedPin.nrOfLights, sortedPin.pin);
440-
if (nb_pins < NUMSTRIPS) {
441-
pins[nb_pins] = sortedPin.pin;
442-
lengths[nb_pins] = sortedPin.nrOfLights;
443-
nb_pins++;
444-
}
445-
}
435+
#if HP_PHYSICAL_DRIVER_S3
436+
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32
437+
int pins[NUMSTRIPS]; //max 16 pins
438+
int lengths[NUMSTRIPS];
439+
int nb_pins=0;
440+
441+
for (const SortedPin &sortedPin : layerV->layerP->sortedPins) {
442+
ESP_LOGD(TAG, "sortedPin s:%d #:%d p:%d", sortedPin.startLed, sortedPin.nrOfLights, sortedPin.pin);
443+
if (nb_pins < NUMSTRIPS) {
444+
pins[nb_pins] = sortedPin.pin;
445+
lengths[nb_pins] = sortedPin.nrOfLights;
446+
nb_pins++;
447+
}
448+
}
446449

447-
//fill the rest of the pins with the pins already used
448-
//preferably NUMSTRIPS is a variable...
449-
if (nb_pins > 0) {
450-
for (uint8_t i = nb_pins; i < NUMSTRIPS; i++) {
451-
pins[i] = pins[i%nb_pins];
452-
lengths[i] = 0;
453-
}
454-
}
455-
ESP_LOGD(TAG, "pins[");
456-
for (int i=0; i<nb_pins; i++) {
457-
ESP_LOGD(TAG, ", %d", pins[i]);
458-
}
459-
ESP_LOGD(TAG, "]\n");
460-
461-
if (nb_pins > 0) {
462-
#if CONFIG_IDF_TARGET_ESP32S3 | CONFIG_IDF_TARGET_ESP32S2
463-
driverP.initled((uint8_t*) layerV->layerP->lights.leds, pins, nb_pins, lengths[0]); //s3 doesn't support lengths so we pick the first
464-
// colorOrder ??
465-
//void initled( uint8_t * leds, int * pins, int numstrip, int NUM_LED_PER_STRIP)
466-
#else
467-
driverP.initled((uint8_t*) layerV->layerP->lights.leds, pins, lengths, nb_pins, (colorarrangment)colorOrder);
468-
#if ML_LIVE_MAPPING
469-
driver.setMapLed(&mapLed);
470-
#endif
471-
//void initled(uint8_t *leds, int *Pinsq, int *sizes, int num_strips, colorarrangment cArr)
450+
//fill the rest of the pins with the pins already used
451+
//preferably NUMSTRIPS is a variable...
452+
if (nb_pins > 0) {
453+
for (uint8_t i = nb_pins; i < NUMSTRIPS; i++) {
454+
pins[i] = pins[i%nb_pins];
455+
lengths[i] = 0;
456+
}
457+
}
458+
ESP_LOGD(TAG, "pins[");
459+
for (int i=0; i<nb_pins; i++) {
460+
ESP_LOGD(TAG, ", %d", pins[i]);
461+
}
462+
ESP_LOGD(TAG, "]\n");
463+
464+
if (nb_pins > 0) {
465+
#if CONFIG_IDF_TARGET_ESP32S3 | CONFIG_IDF_TARGET_ESP32S2
466+
driverP.initled((uint8_t*) layerV->layerP->lights.leds, pins, nb_pins, lengths[0]); //s3 doesn't support lengths so we pick the first
467+
// colorOrder ??
468+
//void initled( uint8_t * leds, int * pins, int numstrip, int NUM_LED_PER_STRIP)
469+
#else
470+
driverP.initled((uint8_t*) layerV->layerP->lights.leds, pins, lengths, nb_pins, (colorarrangment)colorOrder);
471+
#if ML_LIVE_MAPPING
472+
driver.setMapLed(&mapLed);
473+
#endif
474+
//void initled(uint8_t *leds, int *Pinsq, int *sizes, int num_strips, colorarrangment cArr)
475+
#endif
476+
// Variable("Fixture", "brightness").triggerEvent(onChange, UINT8_MAX, true); //set brightness (init is true so bri value not send via udp)
477+
driverP.setBrightness(setMaxPowerBrightnessFactor / 256); //not brighter then the set limit (WIP)
478+
}
472479
#endif
473-
// Variable("Fixture", "brightness").triggerEvent(onChange, UINT8_MAX, true); //set brightness (init is true so bri value not send via udp)
474-
driverP.setBrightness(setMaxPowerBrightnessFactor / 256); //not brighter then the set limit (WIP)
475-
}
476480
#endif
477481
}
478482
}
@@ -482,23 +486,25 @@ void ArtNetDriverMod::loop() {
482486

483487
if (layerV->layerP->lights.header.isPositions == 0) {
484488

485-
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32
486-
if (driverP._brightness != layerV->layerP->lights.header.brightness * setMaxPowerBrightnessFactor >> 8) {
487-
ESP_LOGD(TAG, "setBrightness %d", layerV->layerP->lights.header.brightness);
488-
driverP.setBrightness(layerV->layerP->lights.header.brightness * setMaxPowerBrightnessFactor >> 8);
489-
}
489+
#if HP_PHYSICAL_DRIVER_S3
490+
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32
491+
if (driverP._brightness != layerV->layerP->lights.header.brightness * setMaxPowerBrightnessFactor >> 8) {
492+
ESP_LOGD(TAG, "setBrightness %d", layerV->layerP->lights.header.brightness);
493+
driverP.setBrightness(layerV->layerP->lights.header.brightness * setMaxPowerBrightnessFactor >> 8);
494+
}
490495

491-
if (driverP._gammar != layerV->layerP->lights.header.red/255.0 || driverP._gammag != layerV->layerP->lights.header.green/255.0 || driverP._gammab != layerV->layerP->lights.header.blue/255.0) {
492-
ESP_LOGD(TAG, "setColorCorrection r:%d, g:%d, b:%d", layerV->layerP->lights.header.red, layerV->layerP->lights.header.green, layerV->layerP->lights.header.blue);
493-
driverP.setGamma(layerV->layerP->lights.header.red/255.0, layerV->layerP->lights.header.green/255.0, layerV->layerP->lights.header.blue/255.0);
494-
}
496+
if (driverP._gammar != layerV->layerP->lights.header.red/255.0 || driverP._gammag != layerV->layerP->lights.header.green/255.0 || driverP._gammab != layerV->layerP->lights.header.blue/255.0) {
497+
ESP_LOGD(TAG, "setColorCorrection r:%d, g:%d, b:%d", layerV->layerP->lights.header.red, layerV->layerP->lights.header.green, layerV->layerP->lights.header.blue);
498+
driverP.setGamma(layerV->layerP->lights.header.red/255.0, layerV->layerP->lights.header.green/255.0, layerV->layerP->lights.header.blue/255.0);
499+
}
495500

496-
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2
497-
if (driverP.ledsbuff != nullptr)
498-
driverP.show();
499-
#else
500-
if (driverP.total_leds > 0)
501-
driverP.showPixels(WAIT);
501+
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32S2
502+
if (driverP.ledsbuff != nullptr)
503+
driverP.show();
504+
#else
505+
if (driverP.total_leds > 0)
506+
driverP.showPixels(WAIT);
507+
#endif
502508
#endif
503509
#endif
504510
}

src/MoonLight/ModuleMoonLightInfo.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class ModuleMoonLightInfo : public Module
3535
property = root.add<JsonObject>(); property["name"] = "channelsPerLight"; property["type"] = "number"; property["max"] = 65536;
3636
property = root.add<JsonObject>(); property["name"] = "chipset"; property["type"] = "text"; property["max"] = 32;
3737
property = root.add<JsonObject>(); property["name"] = "FastLED"; property["type"] = "text"; property["max"] = 32;
38+
property = root.add<JsonObject>(); property["name"] = "FastLEDI2S"; property["type"] = "text"; property["max"] = 32;
3839
property = root.add<JsonObject>(); property["name"] = "size"; property["type"] = "coord3D";
3940
property = root.add<JsonObject>(); property["name"] = "layers"; property["type"] = "array"; details = property["n"].to<JsonArray>();
4041
{
@@ -60,6 +61,11 @@ class ModuleMoonLightInfo : public Module
6061
data["chipset"] = TOSTRING(ML_CHIPSET);
6162
const char* fastledVersion = TOSTRING(FASTLED_VERSION);// "." TOSTRING(FASTLED_VERSION_MINOR) "." TOSTRING(FASTLED_VERSION_PATCH);
6263
data["FastLED"] = fastledVersion;
64+
#if FASTLED_USES_ESP32S3_I2S
65+
data["FastLEDI2S"] = "Yes";
66+
#else
67+
data["FastLEDI2S"] = "No";
68+
#endif
6369
data["size"]["x"] = layerP.lights.header.size.x;
6470
data["size"]["y"] = layerP.lights.header.size.y;
6571
data["size"]["z"] = layerP.lights.header.size.z;

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void setup()
115115
// ESP_LOGD(TAG, "averageChar size: %d", sizeof(averageChar));
116116
// ESP_LOGD(TAG, "UpdatedItem size: %d = %d + %d + %d ...", sizeof(UpdatedItem), sizeof(JsonString), sizeof(JsonVariant), sizeof(String));
117117

118-
// pinMode(19, OUTPUT); digitalWrite(19, HIGH); // for serg shield boards: to be done: move to new pin manager module
118+
// pinMode(19, OUTPUT); digitalWrite(19, HIGH); // for serg shield boards: to be done: move to new pin manager module, switch off for S3!!!!
119119
}
120120

121121
void loop()

variants/adafruit_feather_esp32s3_nopsram.ini

Lines changed: 0 additions & 8 deletions
This file was deleted.

variants/esp32-c3-devkitm-1.ini

Lines changed: 0 additions & 12 deletions
This file was deleted.

variants/esp32-c3-supermini.ini

Lines changed: 0 additions & 17 deletions
This file was deleted.

variants/esp32-c3.ini

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[esp32-c3-base]
2+
build_flags =
3+
${env.build_flags}
4+
${moonlight.build_flags}
5+
-D CONFIG_IDF_TARGET_ESP32C3
6+
-DARDUINO_USB_CDC_ON_BOOT=1
7+
-DARDUINO_USB_MODE=1
8+
lib_deps =
9+
${env.lib_deps}
10+
${moonlight.lib_deps}
11+
12+
13+
14+
; commented out as c3 generate FastLED error: FastLED/src/platforms/esp/32/rmt_4/idf4_clockless_rmt_esp32.h:81:46: error: static assertion failed: Invalid pin specified
15+
[env:esp32-c3-devkitm-1]
16+
board = esp32-c3-devkitm-1
17+
board_build.mcu = esp32c3
18+
; Uncomment min_spiffs.csv setting if using EMBED_WWW with ESP32
19+
board_build.partitions = min_spiffs.csv
20+
; Use USB CDC for firmware upload and serial terminal
21+
; board_upload.before_reset = usb_reset
22+
; build_flags =
23+
; ${env.build_flags}
24+
; -DARDUINO_USB_CDC_ON_BOOT=1
25+
; -DARDUINO_USB_MODE=1
26+
; RAM: [= ] 13.6% (used 44696 bytes from 327680 bytes)
27+
; Flash: [==========] 98.4% (used 1934442 bytes from 1966080 bytes)
28+
29+
30+
; Replaced partitioning by no OTA because flash > 100% other partitioning (no ota?) or Tasmota platform needed
31+
[env:esp32-c3-supermini]
32+
board = esp32-c3-devkitm-1
33+
board_build.mcu = esp32c3
34+
; Uncomment min_spiffs.csv setting if using EMBED_WWW with ESP32
35+
; board_build.partitions = min_spiffs.csv
36+
board_build.partitions = boards/ESP32_4MB.csv
37+
; Use USB CDC for firmware upload and serial terminal
38+
board_upload.before_reset = usb_reset
39+
build_flags = ${esp32-c3-base.build_flags}
40+
lib_deps = ${esp32-c3-base.lib_deps}
41+
; RAM: [== ] 22.5% (used 73592 bytes from 327680 bytes)
42+
; Flash: [====== ] 64.9% (used 2041112 bytes from 3145728 bytes)

0 commit comments

Comments
 (0)