From aa98fe487dbed80b3ffe425dfed6e656f958f6dd Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 5 Aug 2026 19:22:41 +0100 Subject: [PATCH 1/6] Update to IDF 5.5.4 --- platformio.ini | 5 +++-- wled00/mbedtls_sha1_shim.cpp | 5 +++-- wled00/src/dependencies/time/TimeLib.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 8a060ba0fe..9757f822b3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -319,8 +319,8 @@ lib_deps = lib_ignore = [esp32_idf_V5] -;; build environment for ESP32 using ESP-IDF 5.3.4 / arduino-esp32 v3.1.10 -platform = https://github.com/tasmota/platform-espressif32/releases/download/2026.02.30/platform-espressif32.zip +;; Platform 2026.05.50 Tasmota Arduino Core 3.3.8.260506 based on IDF 5.5.4.260407 +platform = https://github.com/tasmota/platform-espressif32/releases/download/2026.05.50/platform-espressif32.zip platform_packages = build_unflags = ${common.build_unflags} -Wno-volatile ;; avoid warning on .c files: "-Wno-volatile only applies to c++ files" @@ -331,6 +331,7 @@ build_flags = -g ; -DESP32=ESP32 ;; disabled to avoid compiler warning: "ESP32" redefined ${esp32_all_variants.build_flags} -D WLED_USE_SHARED_RMT ;; ToDO: check if NeoESP32RmtHI is still needed with V5 (see discussion in PR#4838) + -D__unreachable=__builtin_unreachable ;; picolibc (new toolchain-xtensa-esp-elf) dropped __unreachable(), but esp_dmx still calls it ;;-D WLED_DISABLE_INFRARED ;; ToDO: needs more testing with V5 ;;-D WLED_DISABLE_MQTT ;; ToDO: needs more testing with V5 -D WLED_ENABLE_DMX_INPUT diff --git a/wled00/mbedtls_sha1_shim.cpp b/wled00/mbedtls_sha1_shim.cpp index a009553bee..e6882ea48b 100644 --- a/wled00/mbedtls_sha1_shim.cpp +++ b/wled00/mbedtls_sha1_shim.cpp @@ -1,8 +1,9 @@ #include "wled.h" #ifdef ESP32 -// ESP32-C5 on pioarduino uses IDF 5.5+ which has SHA1 built-in, skip shim -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0) #include "mbedtls/sha1.h" +// Some ESP-IDF builds/platforms compile mbedtls without SHA1 support (MBEDTLS_SHA1_C undefined), +// while others (e.g. ESP32-C5 on pioarduino) have it built-in. Only provide the shim when missing. +#if !defined(MBEDTLS_SHA1_C) #include "SHA1Builder.h" // Wrapper functions to map mbedtls SHA1 calls to Arduino SHA1Builder diff --git a/wled00/src/dependencies/time/TimeLib.h b/wled00/src/dependencies/time/TimeLib.h index 5004f07165..0270d9b88b 100644 --- a/wled00/src/dependencies/time/TimeLib.h +++ b/wled00/src/dependencies/time/TimeLib.h @@ -17,7 +17,7 @@ #endif -#if !defined(__time_t_defined) // avoid conflict with newlib or other posix libc +#if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED) // avoid conflict with newlib, picolibc, or other posix libc typedef unsigned long time_t; #endif From 6a886d7af6145ede9c49692d21c78b0992340091 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 10 Aug 2026 18:32:10 +0200 Subject: [PATCH 2/6] put pioarduino V5 platform next to tasmota V5 --- platformio.ini | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 9757f822b3..9422b48780 100644 --- a/platformio.ini +++ b/platformio.ini @@ -319,9 +319,14 @@ lib_deps = lib_ignore = [esp32_idf_V5] -;; Platform 2026.05.50 Tasmota Arduino Core 3.3.8.260506 based on IDF 5.5.4.260407 +;; (default) Platform 2026.05.50 Tasmota Arduino Core 3.3.8.260506 based on IDF 5.5.4.260407 platform = https://github.com/tasmota/platform-espressif32/releases/download/2026.05.50/platform-espressif32.zip platform_packages = + +;; (optional) pioardunio platform - needs 300kB extra flash - Arduino Core v3.3.7 based on ESP-IDF v5.5.2.260206 +platform_pioarduino = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip +platform_packages_pioarduino = + build_unflags = ${common.build_unflags} -Wno-volatile ;; avoid warning on .c files: "-Wno-volatile only applies to c++ files" build_flags = -g @@ -419,8 +424,9 @@ monitor_filters = esp32_exception_decoder [esp32c5] ;; generic definitions for all ESP32-C5 boards ;; NOTE: ESP32-C5 requires pioarduino platform (Tasmota framework doesn't include C5 Arduino libs yet) -platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip -platform_packages = +platform = ${esp32_idf_V5.platform_pioarduino} +platform_packages = ${esp32_idf_V5.platform_packages_pioarduino} + custom_usermods = ;; ${common.default_usermods} ;; ToDO: audiorective compiles, but not tested on C5 yet build_unflags = ${esp32_idf_V5.build_unflags} -D WLED_ENABLE_DMX_INPUT ;; esp_dmx library doesn't support C5 UART registers yet From ba12fdb8718ca676f074d90a070692e7e8de6956 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:00:13 +0200 Subject: [PATCH 3/6] upgrade pioarduino (-C5) to same IDF 5.5.4 align with tasmota platform version --- platformio.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 9422b48780..4e4c7f1744 100644 --- a/platformio.ini +++ b/platformio.ini @@ -323,8 +323,8 @@ lib_ignore = platform = https://github.com/tasmota/platform-espressif32/releases/download/2026.05.50/platform-espressif32.zip platform_packages = -;; (optional) pioardunio platform - needs 300kB extra flash - Arduino Core v3.3.7 based on ESP-IDF v5.5.2.260206 -platform_pioarduino = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip +;; (optional) pioarduino platform - needs 300kB extra flash - Arduino Core v3.3.9 based on ESP-IDF v5.5.4 +platform_pioarduino = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.39/platform-espressif32.zip platform_packages_pioarduino = build_unflags = ${common.build_unflags} From 25302b10d9be4f83065952408dddcc271b9868bb Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:15:35 +0200 Subject: [PATCH 4/6] trying to fix github CI incompatibility error message --- requirements.in | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.in b/requirements.in index a74bd418b9..087a3fd93d 100644 --- a/requirements.in +++ b/requirements.in @@ -1 +1 @@ -platformio>=6.1.17 +platformio>=6.1.19 diff --git a/requirements.txt b/requirements.txt index 75d3bb7669..0468392a84 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,7 +32,7 @@ marshmallow==3.26.1 # via platformio packaging==25.0 # via marshmallow -platformio==6.1.18 +platformio==6.1.19 # via -r requirements.in pyelftools==0.32 # via platformio From 607ac92251a352a1611cd4fa0f881d5d264d55f0 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:54:35 +0200 Subject: [PATCH 5/6] -C5: use pioarduino, remove NTP hack crash on NTP does not occur any more, C5 builds successfully with tasmota core. --- platformio.ini | 5 ++--- wled00/cfg.cpp | 6 ------ wled00/set.cpp | 5 ----- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/platformio.ini b/platformio.ini index 4e4c7f1744..2da3279c00 100644 --- a/platformio.ini +++ b/platformio.ini @@ -423,9 +423,8 @@ monitor_filters = esp32_exception_decoder [esp32c5] ;; generic definitions for all ESP32-C5 boards -;; NOTE: ESP32-C5 requires pioarduino platform (Tasmota framework doesn't include C5 Arduino libs yet) -platform = ${esp32_idf_V5.platform_pioarduino} -platform_packages = ${esp32_idf_V5.platform_packages_pioarduino} +platform = ${esp32_idf_V5.platform} +platform_packages = ${esp32_idf_V5.platform_packages} custom_usermods = ;; ${common.default_usermods} ;; ToDO: audiorective compiles, but not tested on C5 yet build_unflags = ${esp32_idf_V5.build_unflags} diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 8ea967a26b..47bb81ab87 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -669,12 +669,6 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { JsonObject if_ntp = interfaces[F("ntp")]; CJSON(ntpEnabled, if_ntp["en"]); -#ifdef CONFIG_IDF_TARGET_ESP32C5 // ToDO: esp32-c5 crashes on NTP requests, see https://github.com/wled/WLED/pull/5048/changes#r3003182550 - if (ntpEnabled) { DEBUG_PRINTLN("NTP disabled on -C5, as it leads to crashes"); } - // assert failed: udp_new_ip_type /IDF/components/lwip/lwip/src/core/udp.c:1278 (Required to lock TCPIP core functionality!) - ntpEnabled = false; // --> disable NTP support, until the crash is resolved - #warning "enabling NTP lead to crashes on -C5. NTP disabled" -#endif getStringFromJson(ntpServerName, if_ntp[F("host")], 33); // "1.wled.pool.ntp.org" CJSON(currentTimezone, if_ntp[F("tz")]); CJSON(utcOffsetSecs, if_ntp[F("offset")]); diff --git a/wled00/set.cpp b/wled00/set.cpp index dee8d00378..00b4c9409d 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -548,11 +548,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) if (subPage == SUBPAGE_TIME) { ntpEnabled = request->hasArg(F("NT")); -#ifdef CONFIG_IDF_TARGET_ESP32C5 // ToDO: esp32-c5 crashes on NTP requests: assert failed: udp_new_ip_type udp.c:1278 (Required to lock TCPIP core functionality!) - if (ntpEnabled) { DEBUG_PRINTLN("NTP disabled on -C5, as it leads to crashes"); } - ntpEnabled = false; - #warning "enabling NTP lead to crashes on -C5. NTP disabled" -#endif strlcpy(ntpServerName, request->arg(F("NS")).c_str(), 33); useAMPM = !request->hasArg(F("CF")); currentTimezone = request->arg(F("TZ")).toInt(); From 45baf4bdba84ec36ecf8c0466a74630f168e0081 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 10 Aug 2026 20:08:32 +0200 Subject: [PATCH 6/6] fix chip revision printing in V5 espressif uses a new format in ESP.getChipRevision() now: revMajor*100 + revMinor --- wled00/wled.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index d5125c30e2..7d841cdc76 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -413,7 +413,12 @@ void WLED::setup() #else DEBUG_PRINTLN(F("arduino-esp32 v1.0.x\n")); // we can't say in more detail. #endif - DEBUG_PRINTF_P(PSTR("\nCPU: %s rev.%d, %d core(s), %d MHz.\n"), ESP.getChipModel(), (int)ESP.getChipRevision(), ESP.getChipCores(), ESP.getCpuFreqMHz()); + #if ESP_IDF_VERSION_MAJOR > 4 + // chip revision uses a new format in V5 + DEBUG_PRINTF_P(PSTR("\nCPU: %s v%d.%d, %d core(s), %d MHz.\n"), ESP.getChipModel(), (int)ESP.getChipRevision() / 100, (int)ESP.getChipRevision()% 100 , ESP.getChipCores(), ESP.getCpuFreqMHz()); + #else + DEBUG_PRINTF_P(PSTR("\nCPU: %s rev.%d, %d core(s), %d MHz.\n"), ESP.getChipModel(), (int)ESP.getChipRevision(), ESP.getChipCores(), ESP.getCpuFreqMHz()); + #endif DEBUG_PRINTF_P(PSTR("FLASH: %d MB, Mode %d "), (ESP.getFlashChipSize()/1024)/1024, (int)ESP.getFlashChipMode()); #ifdef WLED_DEBUG switch (ESP.getFlashChipMode()) {