What is the purpose of two OTA partition?

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Thu May 10, 2018 8:27 pm

Do I have write custom boot loader for this.

I think i need two different application.


one application which on boot reads sd card to check any .bin file exits then perform OTA process and delete .bin. This application reside in one parition. It will have small size.

Second application is complete application with large size which will be running the main application.

Can you make flash two different application on esp32 in different partition using command line.

I guess full application will reside at factory or OTA_0 first partition.
smaller application will reside at OTA_1 (second partition)


Correct me if I am wrong.

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

Re: What is the purpose of two OTA partition?

Postby chegewara » Thu May 10, 2018 8:37 pm

I think i need two different application.

one application which on boot reads sd card to check any .bin file exits then perform OTA process and delete .bin. This application reside in one parition. It will have small size.

Second application is complete application with large size which will be running the main application.
Yes.
Can you make flash two different application on esp32 in different partition using command line.
I think its possible, at least i can do it with esp32 flash download tool.
I guess full application will reside at factory or OTA_0 first partition.
smaller application will reside at OTA_1 (second partition)
Depends on your needs(chose). Im not sure if its possible to write to factory partition from application and how hard it is, maybe Angus can help here.

PS maybe i will try this option when i end up with current ota project (ota update triggered with mqtt request, plus many other mqtt options)

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Fri Oct 12, 2018 4:40 pm

Hi,
Did you try out with single OTA?

Can I use single partition. Write bin to my SD card file and on startup application apply OTA update to OTA_0.


My custom partition is

nvs,data,nvs,0x9000,16K,
otadata,data,ota,0xd000,8K,
phy_init,data,phy,0xf000,4K,
ota_0,app,ota_0,0x10000,1856K,
ota_1,app,ota_1,0x1e0000,1856K,
storage,data,fat,0x3b0000,128K,




Do I need (two OTA) or (one Factory + single OTA). which method is better .

Do we need otadata and phy_init partitions or they can be optional.

If we see my total allocation is few hundred kb less than 4MB. Can I increase my OTA_0 and OTA_1 more. I did try, but no success.


Can some one reply please. we need to make decision about our partition. as i understand once you release your product with device. you cannot change partition via OTA.

Can some ones answer my questions please.

Thanks,
Naeem
Last edited by snahmad75 on Fri Nov 30, 2018 4:58 pm, edited 1 time in total.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Fri Nov 30, 2018 4:46 pm

chegewara wrote:
Thu May 10, 2018 7:38 pm
You cant write to partition you are running from, so you need at least 2 partitions:
- 2x OTA
- factory + OTA

But now when you asking this question i have idea. Maybe, but just maybe, it is possible to write ota.bin image to sd card, then reboot esp32. Now, when bootloader find ota.bin file on SD card then perform ota update, delete image from sd card, restart esp32. Even if this is not possible then you can have similar procedure on factory partition. This way you can have two options to ota update, from sd card or from internet. Im assuming that ota update procedure from sd card requires minimum partition size, far less than your regular application.

Is this possible. Have anyone try it using only 1x OTA with sd card.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Fri Nov 30, 2018 4:59 pm

Now I am getting failure after increase my NVS size with signed bins.

Check this out.

viewtopic.php?p=34714#p34714

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

Re: What is the purpose of two OTA partition?

Postby chegewara » Sat Dec 01, 2018 7:56 am

snahmad75 wrote:
Fri Nov 30, 2018 4:46 pm
Is this possible. Have anyone try it using only 1x OTA with sd card.
You cant do it, because you cant overwrite active (currently running partition). What will happen when you overwrite part of code you are running and is responsible for performing ota update? Think.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Sat Dec 01, 2018 12:46 pm

ok. make sense.

jerome
Posts: 37
Joined: Wed Jan 23, 2019 2:28 pm

Re: What is the purpose of two OTA partition?

Postby jerome » Fri Mar 15, 2019 5:15 pm

You cant do it, because you cant overwrite active (currently running partition)
The running partition would not be the application to update, but the partition where the boot loader is stored.
From my point of view, this should work :

- Download a new fw from Internet to the SDCard from the main app.
- Press reset, system always boot from OTA partition where a simple SD card reader/writer is implemented
- OTA partition checks if new binary file is present on the SDcard
- If so, it read all binary from SD and write to Main partition (which is not running)
- If no firmware is available on the SD, it jumps to Main app vector.

Why this would not work ?

Who is online

Users browsing this forum: Bing [Bot] and 110 guests