From 1a9e86a6b3bb1391c2c133e61d11c2f7b23b374c Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:30:30 +0100 Subject: [PATCH] Fix ESP32 safeboot propagating upload --- tasmota/tasmota_support/support_tasmota.ino | 10 +++++++--- tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_flash.ino | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tasmota/tasmota_support/support_tasmota.ino b/tasmota/tasmota_support/support_tasmota.ino index 85055969f..0e8f7f7fd 100644 --- a/tasmota/tasmota_support/support_tasmota.ino +++ b/tasmota/tasmota_support/support_tasmota.ino @@ -1290,7 +1290,8 @@ void Every250mSeconds(void) if (TasmotaGlobal.ota_state_flag && CommandsReady()) { TasmotaGlobal.ota_state_flag--; if (2 == TasmotaGlobal.ota_state_flag) { -#ifdef CONFIG_IDF_TARGET_ESP32C3 +//#ifdef CONFIG_IDF_TARGET_ESP32C3 +#ifdef ESP32 OtaFactoryWrite(false); #endif RtcSettings.ota_loader = 0; // Try requested image first @@ -1372,7 +1373,8 @@ void Every250mSeconds(void) } else #endif // USE_WEBCLIENT_HTTPS if (EspSingleOtaPartition()) { -#ifdef CONFIG_IDF_TARGET_ESP32C3 +//#ifdef CONFIG_IDF_TARGET_ESP32C3 +#ifdef ESP32 OtaFactoryWrite(true); #endif RtcSettings.ota_loader = 1; // Try safeboot image next @@ -1542,10 +1544,12 @@ void Every250mSeconds(void) { if (!TasmotaGlobal.global_state.network_down) { #ifdef FIRMWARE_MINIMAL -#ifdef CONFIG_IDF_TARGET_ESP32C3 +//#ifdef CONFIG_IDF_TARGET_ESP32C3 +#ifdef ESP32 if (OtaFactoryRead()) { OtaFactoryWrite(false); TasmotaGlobal.ota_state_flag = 3; + AddLog(LOG_LEVEL_DEBUG, PSTR("OTA: Propagating upload")); } #endif if (1 == RtcSettings.ota_loader) { diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_flash.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_flash.ino index c1df40a33..ca0af5319 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_flash.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_flash.ino @@ -157,7 +157,8 @@ extern "C" { esp_partition_erase_range(otadata_partition, 0, SPI_FLASH_SEC_SIZE * 2); } if (force_ota) { -#ifdef CONFIG_IDF_TARGET_ESP32C3 +//#ifdef CONFIG_IDF_TARGET_ESP32C3 +#ifdef ESP32 OtaFactoryWrite(true); #endif RtcSettings.ota_loader = 1; // force OTA at next reboot