fix(ota): bypass 64KB flash block erase, increase WDT timeouts, and place encoder table in DRAM
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m11s

This commit is contained in:
2026-09-12 15:52:12 +02:00
parent c3bc42fe94
commit 6b8e8f3e8d
5 changed files with 40 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
#include "nvs.h"
#include "cJSON.h"
#include "wifi_manager.h"
#include "rfid_manager.h"
#include "ota_manager.h"
static const char *TAG = "ota";
@@ -488,6 +489,7 @@ static void ota_download_task(void *arg)
set_state(OTA_STATUS_DOWNLOADING, "Starting download...");
ESP_LOGI(TAG, "Starting HTTPS OTA from: %s", s_release.download_url);
rfid_manager_pause(true);
esp_http_client_config_t http_cfg = {
.url = s_release.download_url,
@@ -506,6 +508,7 @@ static void ota_download_task(void *arg)
esp_https_ota_handle_t ota_handle = NULL;
esp_err_t err = esp_https_ota_begin(&ota_cfg, &ota_handle);
if (err != ESP_OK || ota_handle == NULL) {
rfid_manager_pause(false);
wifi_manager_release_net_lock();
ESP_LOGE(TAG, "esp_https_ota_begin failed: %s", esp_err_to_name(err));
set_state(OTA_STATUS_FAILED, "Failed to connect to image");
@@ -521,6 +524,7 @@ static void ota_download_task(void *arg)
if (memcmp(new_app_info.app_elf_sha256, running->app_elf_sha256, sizeof(new_app_info.app_elf_sha256)) == 0) {
ESP_LOGW(TAG, "Incoming image has identical ELF SHA-256 as running app - aborting flash write");
esp_https_ota_abort(ota_handle);
rfid_manager_pause(false);
wifi_manager_release_net_lock();
set_state(OTA_STATUS_UP_TO_DATE, "Firmware is already up to date");
s_ota_task_handle = NULL;
@@ -533,6 +537,7 @@ static void ota_download_task(void *arg)
if (s_cancel_requested) {
ESP_LOGW(TAG, "OTA canceled by user");
esp_https_ota_abort(ota_handle);
rfid_manager_pause(false);
wifi_manager_release_net_lock();
set_state(OTA_STATUS_IDLE, "Update canceled");
s_ota_task_handle = NULL;
@@ -553,6 +558,8 @@ static void ota_download_task(void *arg)
vTaskDelay(pdMS_TO_TICKS(10));
}
rfid_manager_pause(false);
if (err == ESP_OK) {
if (esp_https_ota_is_complete_data_received(ota_handle)) {
esp_err_t finish_err = esp_https_ota_finish(ota_handle);