Make controller input best-effort and harden OTA rollback.
Accel/tap use fire-and-forget ESP-NOW with a 10 ms FreeRTOS-safe cadence, OTA recovers from seq gaps and auto-reboots after success, and bootloader app rollback confirms after a stable boot. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+7
-1
@@ -97,7 +97,13 @@ int ota_uart_prepare(uint32_t total_size) {
|
||||
esp_ota_handle_t handle;
|
||||
esp_err_t err = esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &handle);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "esp_ota_begin failed: %s", esp_err_to_name(err));
|
||||
if (err == ESP_ERR_OTA_ROLLBACK_INVALID_STATE) {
|
||||
ESP_LOGE(TAG,
|
||||
"esp_ota_begin blocked: running app still PENDING_VERIFY "
|
||||
"(wait for ota_confirm ~8 s after boot, or let rollback finish)");
|
||||
} else {
|
||||
ESP_LOGE(TAG, "esp_ota_begin failed: %s", esp_err_to_name(err));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user