ESP32 OTA回退
-
- Posts: 6
- Joined: Fri Nov 30, 2018 3:11 pm
ESP32 OTA回退
想知道ESP32通过OTA升级后,镜像写入到OTA0和1分区,怎么让ESP32从factory分区启动来达到恢复出厂设置的目的。希望有大佬帮解决下,谢谢。
-
- Posts: 132
- Joined: Thu Nov 15, 2018 2:06 am
Re: ESP32 OTA回退
- esp_err_t ret = ESP_OK;
- const esp_partition_t *partition = NULL;
- partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP,
- ESP_PARTITION_SUBTYPE_APP_FACTORY, NULL);
- if (partition == NULL) {
- partition = esp_ota_get_next_update_partition(NULL);
- }
- ret = esp_ota_set_boot_partition(partition);
- esp_restart();
Who is online
Users browsing this forum: No registered users and 157 guests