OTA clarification

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: OTA clarification

Postby chegewara » Mon Mar 19, 2018 5:26 pm

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: OTA clarification

Postby ESP_Angus » Mon Mar 19, 2018 10:22 pm

chegewara wrote: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.

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: OTA clarification

Postby davdav » Tue Mar 20, 2018 9:18 am

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

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: OTA clarification

Postby chegewara » Tue Mar 20, 2018 11:57 am

The solution you want to use (factory + OTA) is implemented here:
https://github.com/chegewara/esp32-ota-with-ble-setup

meneldor
Posts: 75
Joined: Mon Dec 25, 2017 7:28 am

Re: OTA clarification

Postby meneldor » Tue May 08, 2018 12:31 pm

chegewara wrote: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.

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: OTA clarification

Postby chegewara » Tue May 08, 2018 1:15 pm

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.

meneldor
Posts: 75
Joined: Mon Dec 25, 2017 7:28 am

Re: OTA clarification

Postby meneldor » Tue May 08, 2018 3:02 pm

chegewara wrote: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?)

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: OTA clarification

Postby chegewara » Tue May 08, 2018 3:08 pm

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.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: OTA clarification

Postby WiFive » Tue May 08, 2018 10:11 pm

Bootloader code was split up into multiple files
https://github.com/espressif/esp-idf/co ... 0435e204d4

meneldor
Posts: 75
Joined: Mon Dec 25, 2017 7:28 am

Re: OTA clarification

Postby meneldor » Wed May 09, 2018 3:59 am

WiFive wrote: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?

Who is online

Users browsing this forum: No registered users and 115 guests