File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,27 @@ Change offset for other apps:
4040- ota_1 - 0x4E0000
4141- ota_2 - 0x7A0000
4242- ota_3 - 0xA60000
43- - ota_4 - 0xD20000
43+ - ota_4 - 0xD20000
44+
45+ ## Updating apps to fallback to bootloader
46+
47+ The bootloader is using OTA mechanism. It's necessary to add following code to the application
48+ in order to reboot to bootloader:
49+
50+ ```
51+ // Get the partition structure for the factory partition
52+ const esp_partition_t *factory_partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, NULL);
53+ if (factory_partition != NULL) {
54+ if (esp_ota_set_boot_partition(factory_partition) == ESP_OK) {
55+ printf("Set boot partition to factory, restarting now.\n");
56+ } else {
57+ printf("Failed to set boot partition to factory.\n");
58+ }
59+ } else {
60+ printf("Factory partition not found.\n");
61+ }
62+
63+ fflush(stdout);
64+ printf("Restarting now.\n");
65+ esp_restart();
66+ ```
You can’t perform that action at this time.
0 commit comments