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 » Tue May 08, 2018 2:11 pm

Hi,

My custom partition is not working

# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
ota_0, app, ota_0, 0x10000, 0x177000
ota_1, app, ota_1, , 0x177000
storage, data, fat, ,1M

any idea why?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: What is the purpose of two OTA partition?

Postby kolban » Tue May 08, 2018 2:15 pm

In what way is it "not working"?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

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

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Tue May 08, 2018 2:20 pm

No debug output.

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

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Tue May 08, 2018 2:25 pm

But this custom partition works. It uses factory . previous one uses two OTA. any idea why?. I want to avoid wasting my space. I need each OTA about 1.5M

# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 0x1f0000
storage, data, fat, ,1M

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

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Tue May 08, 2018 2:32 pm


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

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Tue May 08, 2018 3:12 pm

It could be due to alignment issue

This works.
factory, app, factory, 0x10000, 0x1f0000

but this does not. different size.

ota_0, app, ota_0, 0x10000, 0x177000
ota_1, app, ota_1, , 0x177000

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: What is the purpose of two OTA partition?

Postby kolban » Tue May 08, 2018 4:03 pm

See the following.

http://esp-idf.readthedocs.io/en/latest ... ffset-size

It reads:
App partitions have to be at offsets aligned to 0x10000 (64K). If you leave the offset field blank, the tool will automatically align the partition. If you specify an unaligned offset for an app partition, the tool will return an error.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

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

Re: What is the purpose of two OTA partition?

Postby snahmad75 » Tue May 08, 2018 5:12 pm

ok, Alignment applies to offset only not size. which is same and correct on all three examples.

This works

# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 0x1f0000
storage, data, fat, ,1M

but this does not

# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
ota_0, app, ota_0, 0x10000, 0x1f0000
ota_1, app, ota_1, , 0x1f0000
storage, data, fat, ,1M

any idea why not.

with no storage this also works.

# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
ota_0, app, ota_0, 0x10000, 0x1f0000
ota_1, app, ota_1, , 0x1f0000

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: What is the purpose of two OTA partition?

Postby fly135 » Tue May 08, 2018 6:30 pm

snahmad75 wrote:ok, Alignment applies to offset only not size. which is same and correct on all three examples.
The one that doesn't work exceeds 4MB of flash. That's all I can see that might be an issue.

John A

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: What is the purpose of two OTA partition?

Postby fly135 » Tue May 08, 2018 6:32 pm

robpelu wrote:And now the question... do you see some danger in this approach, one that I couldn't see until now ?
The only one I see is that the update process failing to write somewhere in the OTA partition and then not possible to boot that one, but the factory firmware will keep executing to update again, and at some point it should succeed.
Sounds like a good idea to me. I don't see why it should be any less reliable than using two OTA partitions.

John A

Who is online

Users browsing this forum: No registered users and 130 guests