1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

Fix QTA erase after factory partition update

This commit is contained in:
Fredrik Fornstad 2018-09-14 19:56:18 +02:00 committed by Andy Green
parent fd810f198a
commit 6104a25f1f
2 changed files with 3 additions and 5 deletions

View file

@ -109,7 +109,7 @@ static LWS_INLINE void uv_close(uv_handle_t *h, void *v)
#define LWS_MAGIC_REBOOT_TYPE_REQ_FACTORY 0xb00bcafe
#define LWS_MAGIC_REBOOT_TYPE_FORCED_FACTORY 0xfaceb00b
#define LWS_MAGIC_REBOOT_TYPE_FORCED_FACTORY_BUTTON 0xf0cedfac
#define LWS_MAGIC_REBOOT_TYPE_REQ_FACTORY_ERASE_OTA 0xfac0eeee
/* user code provides these */

View file

@ -1032,14 +1032,12 @@ lws_esp_ota_get_boot_partition(void)
}
}
/* destroy our OTA image header */
spi_flash_erase_range(ota->address, 4096);
/*
* with no viable OTA image, we will come back up in
* We send a message to the bootloader to erase the OTA header, we will come back up in
* factory where the user can reload the OTA image
*/
lwsl_notice(" FACTORY copy successful, rebooting\n");
lws_esp32_restart_guided(LWS_MAGIC_REBOOT_TYPE_REQ_FACTORY_ERASE_OTA);
retry:
esp_restart();
}