File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,19 @@ Change offset for other apps:
5050## Updating apps to fallback to bootloader
5151
5252The bootloader is using OTA mechanism. It's necessary to add following code to the application
53- in order to reboot to bootloader:
53+ in order to reboot to bootloader.
54+
55+ Put the following code to main, before starting the rest of the application:
56+ ```
57+ #include "esp_ota_ops.h"
58+
59+ const esp_partition_t* factory_partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, NULL);
60+ if (factory_partition != NULL) {
61+ esp_ota_set_boot_partition(factory_partition);
62+ }
63+ ```
64+
65+ Here's more elaborate version which can be put somwhere into application, like reaction on back button:
5466
5567```
5668// Get the partition structure for the factory partition
You can’t perform that action at this time.
0 commit comments