fix(ota): reboot loop
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m16s

This commit is contained in:
2026-09-13 23:06:56 +02:00
parent 57cf8225bc
commit 2f228b2b3d
3 changed files with 15 additions and 13 deletions

View File

@@ -519,6 +519,7 @@ static void ota_download_task(void *arg)
esp_https_ota_config_t ota_cfg = {
.http_config = &http_cfg,
.bulk_flash_erase = false,
};
esp_https_ota_handle_t ota_handle = NULL;
@@ -551,7 +552,6 @@ static void ota_download_task(void *arg)
}
}
int chunk_counter = 0;
int last_logged_step = -1;
while (1) {
if (s_cancel_requested) {
@@ -584,10 +584,8 @@ static void ota_download_task(void *arg)
}
}
/* Yield every 4 chunks (16 KB) to feed the task watchdog without throttling throughput */
if (++chunk_counter % 4 == 0) {
vTaskDelay(1);
}
/* Yield every chunk to feed the task watchdog and let IDLE/Wi-Fi tasks run smoothly */
vTaskDelay(pdMS_TO_TICKS(1));
}
rfid_manager_pause(false);
@@ -657,7 +655,7 @@ esp_err_t ota_manager_start_update_async(void)
}
set_state(OTA_STATUS_DOWNLOADING, "Starting download...");
BaseType_t ret = xTaskCreatePinnedToCore(
ota_download_task, "ota_update", 8192, NULL, 5, &s_ota_task_handle, 0);
ota_download_task, "ota_update", 10240, NULL, 5, &s_ota_task_handle, 0);
if (ret != pdPASS) {
set_state(OTA_STATUS_FAILED, "Out of memory");
return ESP_ERR_NO_MEM;