Dedicated or combined OTA

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Dedicated or combined OTA

Postby Ritesh » Mon Nov 19, 2018 6:00 pm

loboris wrote:
Sun Nov 18, 2018 10:56 am
brp80000 wrote:
Sun Nov 18, 2018 7:02 am
Please explain that contains the "factory"...
OTA_0 and OTA_1 contain alternately updating the firmware.
As I understand it, in the "factory" area you can write a simple initial firmware, which will be loaded into the OTA_0 area.
If a piece of the program from OTA_0 in the future will start the firmware update it will be located in OTA_1. Continue alternating OTA_0 and OTA_1.
Is the "factory" area no longer used?

You can use OTA_0 and OTA_1 without factory partition.
If the factory partition is used, the the code will run from it only until the 1st OTA upgrade, after that, the code will run from OTA_0 or OTA_1, whichever was updated last.
If both OTA_0 and OTA_1 gets corrupted, the code will run from factory partition again.
You can force running from factory partition (or ota partition different from the currently active partition) from application code or from the 2nd stage bootloader.
You can upgrade your factory partition while running from one of the OTA partitions by slightly modifying the the OTA upgrade code.
Hi Loboris,

So, If we create two OTA partion then default firmware will be started from default partition. Then we can update firmware between 2 OTA partirion. So, Default partition will be used to keep safe image in case both OTA partion will be failed to boot firmware image. Also we can update default partition as well to keep sync it with updated image from OTA 0 or OTA 1 partitions based on firmware running state.

Let me correct if I am wrong at any place.
Regards,
Ritesh Prajapati

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: Dedicated or combined OTA

Postby loboris » Mon Nov 19, 2018 6:18 pm

Ritesh wrote:
Mon Nov 19, 2018 6:00 pm
So, If we create two OTA partion then default firmware will be started from default partition. Then we can update firmware between 2 OTA partirion. So, Default partition will be used to keep safe image in case both OTA partion will be failed to boot firmware image. Also we can update default partition as well to keep sync it with updated image from OTA 0 or OTA 1 partitions based on firmware running state.

Let me correct if I am wrong at any place.

If by "default partition" you mean "factory partition", than you are right.
It is safer to never update the factory partition, but you can do it, if absolutely necessary.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Dedicated or combined OTA

Postby Ritesh » Mon Nov 19, 2018 6:27 pm

loboris wrote:
Mon Nov 19, 2018 6:18 pm
Ritesh wrote:
Mon Nov 19, 2018 6:00 pm
So, If we create two OTA partion then default firmware will be started from default partition. Then we can update firmware between 2 OTA partirion. So, Default partition will be used to keep safe image in case both OTA partion will be failed to boot firmware image. Also we can update default partition as well to keep sync it with updated image from OTA 0 or OTA 1 partitions based on firmware running state.

Let me correct if I am wrong at any place.

If by "default partition" you mean "factory partition", than you are right.
It is safer to never update the factory partition, but you can do it, if absolutely necessary.
Yes. Factory Default Partition. Mostly we will keep factory Default partition as it is like production firmware and keep updating firmware between OTA0 and OTA1 partitions.

Thanks for your quick response for same.
Regards,
Ritesh Prajapati

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

Re: Dedicated or combined OTA

Postby meneldor » Tue Nov 20, 2018 8:50 pm

My favorite is to keep one simple, stable and small factory partition and update only one ota partition. When the ota app detects an update reboots to factory, download/flash and boots back to ota. Im using the console lib in the factory app to be able to manually change/flash the ota app. I have 4mb board and cant waste space :)

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Dedicated or combined OTA

Postby Ritesh » Fri Nov 23, 2018 8:15 am

meneldor wrote:
Tue Nov 20, 2018 8:50 pm
My favorite is to keep one simple, stable and small factory partition and update only one ota partition. When the ota app detects an update reboots to factory, download/flash and boots back to ota. Im using the console lib in the factory app to be able to manually change/flash the ota app. I have 4mb board and cant waste space :)
Hi,

Yes. That can also be possible to update only OTA0 partition to update image as you have mentioned but for that you need to manually switch to default image and can update image into OTA0 partition. After that you can switch to that OTA0 partition after updating image successfully but you need to reboot multiple times to do it their way.

So, I believe you can do it for application code itself without doing any changes into boot-loader code
Regards,
Ritesh Prajapati

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

Re: Dedicated or combined OTA

Postby meneldor » Sun Nov 25, 2018 11:15 am

It reboots twice and sets a flag in NVS for the state. The ota app checks periodically for new version and if there is any reboots to factory, download/flash and reboots again to ota. I can also initiate this with mqtt command or in the console(manually in the factory app).

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Dedicated or combined OTA

Postby Ritesh » Tue Nov 27, 2018 8:40 am

meneldor wrote:
Sun Nov 25, 2018 11:15 am
It reboots twice and sets a flag in NVS for the state. The ota app checks periodically for new version and if there is any reboots to factory, download/flash and reboots again to ota. I can also initiate this with mqtt command or in the console(manually in the factory app).
Yes. That is also possible as per your requirement to move further.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: Google [Bot] and 113 guests