Dynamically changing the partition file.

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

Dynamically changing the partition file.

Postby fly135 » Thu Apr 18, 2019 5:55 pm

I'm would like to build multiple versions of my app to retain backwards compatibility with devices that must use OTA. I need to change the partition layout going forward, but want to keep the old one for OTA updates. I'm thinking that just building a different version to be OTA'd might be ok, since you can't change the partitions with OTA anyway. But I'm not sure that the code won't have something depends on partition layout.

Basically I'm splitting a partition I used for a file system into two paritions of FS and a second NVS.

So this....

storage, data, spiffs, 0x210000, 0xF0000,

later becomes this....

storage, data, spiffs, 0x210000, 0x80000,
secstore, data, nvs, 0x290000, 0x70000,

Can I use an environment variable or compiler define to switch between two partition definition files? Or can I just ignore the difference when I'm not flashing over USB? I.E. use bin file for OTA only.

John A

Posts: 4027
Joined: Thu Nov 26, 2015 4:08 am

Re: Dynamically changing the partition file.

Postby ESP_Sprite » Fri Apr 19, 2019 2:30 am

As far as I'm aware, everything running on the ESP32 proper should use the partition table to find where things live, not offsets. That should allow you to upload the same OTA package to devices with different partition layouts without issue. As you noticed, serial uploads to the bootloader are an exception, as they use absolute addresses.

User avatar
Posts: 40
Joined: Fri Feb 09, 2018 12:20 pm

Re: Dynamically changing the partition file.

Postby luisonoff » Fri Aug 30, 2019 12:51 pm

For future users who find this: dynamically changing the partition table is doable.
I explain how we did it in this other topic: viewtopic.php?f=2&t=11482&p=48589#p48589

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 43 guests