Page 2 of 4

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 2:11 pm
by snahmad75
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?

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 2:15 pm
by kolban
In what way is it "not working"?

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 2:20 pm
by snahmad75
No debug output.

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 2:25 pm
by snahmad75
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

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 2:32 pm
by snahmad75

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 3:12 pm
by snahmad75
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

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 4:03 pm
by kolban
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.

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 5:12 pm
by snahmad75
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

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 6:30 pm
by fly135
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

Re: What is the purpose of two OTA partition?

Posted: Tue May 08, 2018 6:32 pm
by fly135
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