From 38a0a419384d8cb6f4e670c7257f16144bb16306 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 21 Oct 2026 15:14:47 +0200 Subject: [PATCH] Fix ESP32 PWMFrequency < 8 result in WDT restart (#25155) --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/tasmota_support/support_tasmota.ino | 24 ++------------------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f480c772e..99682af2d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Several buffer overflows - MiEL HVAC Modbus no response timeouts now serves the RS485 slave from its own task (#25157) +- ESP32 PWMFrequency < 8 result in WDT restart (#25155) ### Removed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index aeead75cf..25fe9c0db 100755 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -127,6 +127,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ### Fixed - Several buffer overflows +- ESP32 PWMFrequency < 8 result in WDT restart [#25155](https://github.com/arendst/Tasmota/issues/25155) - MiEL HVAC Modbus no response timeouts now serves the RS485 slave from its own task [#25157](https://github.com/arendst/Tasmota/issues/25157) ### Removed \ No newline at end of file diff --git a/tasmota/tasmota_support/support_tasmota.ino b/tasmota/tasmota_support/support_tasmota.ino index 1a6a82d43..f385382df 100644 --- a/tasmota/tasmota_support/support_tasmota.ino +++ b/tasmota/tasmota_support/support_tasmota.ino @@ -2202,9 +2202,6 @@ void GpioInit(void) } } - analogWriteRange(Settings->pwm_range); // Default is 1023 (Arduino.h) - analogWriteFreq(Settings->pwm_frequency); // Default is 1000 (core_esp8266_wiring_pwm.c) - #ifdef ESP8266 if ((2 == Pin(GPIO_TXD)) || (H801 == TasmotaGlobal.module_type)) { Serial.set_tx(2); } SetSerialSwap(); @@ -2296,25 +2293,6 @@ void GpioInit(void) digitalWrite(i, 0); } -/* - // Until 20210726 - - // Set any non-used GPIO to INPUT - Related to resetPins() in support_legacy_cores.ino - // Doing it here solves relay toggles at restart. -#if CONFIG_IDF_TARGET_ESP32C3 - else if (((i < 11) || (i > 17)) && (GPIO_NONE == mpin)) { // Skip SPI flash interface - if (!((20 == i) || (21 == i))) { // Skip serial - pinMode(i, INPUT); - } - } -#else // CONFIG_IDF_TARGET_ESP32C3 - else if (((i < 6) || (i > 11)) && (GPIO_NONE == mpin)) { // Skip SPI flash interface - if (!((1 == i) || (3 == i))) { // Skip serial - pinMode(i, INPUT); - } - } -#endif // CONFIG_IDF_TARGET_ESP32C3 -*/ #ifdef ESP8266 // Set any non-used GPIO to INPUT - Related to resetPins() in support_legacy_cores.ino // Doing it here solves relay toggles at restart. @@ -2405,7 +2383,9 @@ void GpioInit(void) } #endif // ESP8266 + analogWriteRange(Settings->pwm_range); // Default is 1023 (Arduino.h) GpioInitPwm(); + analogWriteFreq(Settings->pwm_frequency); // Default is 1000 (core_esp8266_wiring_pwm.c) (Moved after init PWM #25155) for (uint32_t i = 0; i < MAX_LEDS; i++) { if (PinUsed(GPIO_LED1, i)) {