Page 1 of 1
ESP32 OTA回退
Posted: Wed Dec 12, 2018 10:17 am
by Kwingesp32
想知道ESP32通过OTA升级后,镜像写入到OTA0和1分区,怎么让ESP32从factory分区启动来达到恢复出厂设置的目的。希望有大佬帮解决下,谢谢。
Re: ESP32 OTA回退
Posted: Mon Dec 17, 2018 1:38 pm
by ESP_@In逍遥子
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();
你试一试,有问题,在回复讨论
Re: ESP32 OTA回退
Posted: Thu Dec 27, 2018 1:28 pm
by Kwingesp32
感谢,我有时间试一下,刚看到