Setting Ota data to boot from Ota_0

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

Setting Ota data to boot from Ota_0

Postby jerome » Wed Aug 07, 2019 10:12 am

Dear all,
I'm thinking about setting the default Ota_data to boot from Ota_0 partition rather than booting from factory.
My partitions are defined as follow :

nvs, data, nvs, 0x9000, 0x4000,
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000,
app, app, ota_0, 0x10000, 0x370000,
bootloader, app, factory, 0x380000, 512K,

My custom Bootloader is located at 0x38000, my main app is located at 0x10000.
For production, we use the flash download tool which is configured to burn all those partitions to their correct address.

ANYWAY, since initial Ota_data are only 0xFF's, the first boot starts from factory partition, which is by default my bootloader.
That means I've to run a firmware upgrade to re-burn my app at 0x10000, then if the upgrade is successful the bootloader will call esp_ota_set_boot_partition() that will setup Ota_data to boot from Ota_0.

When the upgrade is performed, I can read the Ota_data partition and find the following :

01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF 9A 98 43 47
then all 0xFF's

My question are :
1) What is the format of the Ota_data read ? I cannot find the info, I guess the last 4 bytes are a MD5 or checksum of the partition, and 01 is the index of the first Ota_data ? Is there a description somewhere ?

2) How can I generate a ota_data.bin file that is set to boot from Ota_0 rather than factory ?

Any help would be appreciated
Thanks


Who is online

Users browsing this forum: No registered users and 121 guests