Page 3 of 4

Re: OTA clarification

Posted: Mon Mar 19, 2018 5:26 pm
by chegewara
I dont know if you can update factory partition this way, but you can have 2x OTA and no factory partition. This will work for sure.

Re: OTA clarification

Posted: Mon Mar 19, 2018 10:22 pm
by Angus
I dont know if you can update factory partition this way, but you can have 2x OTA and no factory partition. This will work for sure.
That's correct. This is the recommended configuration if free space is too limited for a dedicated factory partition.

Re: OTA clarification

Posted: Tue Mar 20, 2018 9:18 am
by davdav
Thank you @chegewara and @ESP_Angus.

I have checked that esp_ota_get_next_update_partition() is not able to point to factory partition.

In order to save more space we are thinking about using a "small" factory where only the OTA process is done and 1 OTA partition which will store the current application.

Using what explained here:
https://esp32.com/viewtopic.php?f=2&t=4 ... ory#p19208

it seems possible to revert from OTA partition to factory. Therefore when we need to upgrade the application, we set factory partition for next boot and then start the OTA process.

Thanks

Re: OTA clarification

Posted: Tue Mar 20, 2018 11:57 am
by chegewara
The solution you want to use (factory + OTA) is implemented here:
https://github.com/chegewara/esp32-ota-with-ble-setup

Re: OTA clarification

Posted: Tue May 08, 2018 12:31 pm
by meneldor
The solution you want to use (factory + OTA) is implemented here:
https://github.com/chegewara/esp32-ota-with-ble-setup
Im currently on the OTA part in my project and want to use setup as @davdav (small factory+ single ota) so i read your project and especially the bootloader part.
The current version of the bootloader_start.c is 93 lines https://github.com/espressif/esp-idf/bl ... er_start.c where your https://github.com/chegewara/esp32-ota- ... er_start.c is almost 1000.
I didnt find any tutorial or more detailed explanation of the bootloader part.

Re: OTA clarification

Posted: Tue May 08, 2018 1:15 pm
by chegewara
This is only change in bootloader ive done:
https://esp32.com/viewtopic.php?f=13&t= ... 908#p16328

You can take new bootloader and follow this topic.

Re: OTA clarification

Posted: Tue May 08, 2018 3:02 pm
by meneldor
This is only change in bootloader ive done:
https://esp32.com/viewtopic.php?f=13&t= ... 908#p16328

You can take new bootloader and follow this topic.
You dont even use ForceFactoryBoot in your code. Also, it seems that there is alot additional code in your BL which i cant find in the original(it might be changed?)

Re: OTA clarification

Posted: Tue May 08, 2018 3:08 pm
by chegewara
Like i said, only part changed in bootloader component is from this topic.
https://github.com/chegewara/esp32-ota- ... #L291-L315

The rest of my code is mix of esp-idf ota example:
https://github.com/espressif/esp-idf/tr ... system/ota

bootwifi from Kolban's repository:
https://github.com/nkolban/esp32-snippe ... g/bootwifi

and my own ble server implementation also based on cpp-utils from Kolban's repository.

Re: OTA clarification

Posted: Tue May 08, 2018 10:11 pm
by WiFive
Bootloader code was split up into multiple files
https://github.com/espressif/esp-idf/co ... 0435e204d4

Re: OTA clarification

Posted: Wed May 09, 2018 3:59 am
by meneldor
Bootloader code was split up into multiple files
https://github.com/espressif/esp-idf/co ... 0435e204d4
Thank you, WiFive! So, now i dont need to copy the bootloader_support folder to the subproject/ too?