Page 1 of 1

Create a partition in code

Posted: Fri Oct 27, 2023 11:36 am
by chruge
Dear all

Is there a IDF call to create new partition (out of the program code)?

After OTA I want to use a data partition, that the previous FW-Version did not have...

Kind regards

Chris

Re: Create a partition in code

Posted: Mon Oct 30, 2023 1:17 pm
by mbratch
I found this with a little searching. Is this helpful?
ESP32: Partition Table Update Through OTA

Re: Create a partition in code

Posted: Mon Jan 15, 2024 12:57 pm
by chruge
Thank you for the reply.

It's interessting but not what I was looking for. Of course I can modify the Flash using the SPI interface. I was hoping that there's an API in the IDF to create and delete partitions.

Kind regards

Chris

Re: Create a partition in code

Posted: Mon Jan 15, 2024 2:35 pm
by ESP_adokitkat
Hello. There in no official higher-level API for this at the moment.

Re: Create a partition in code

Posted: Tue Jan 16, 2024 1:26 am
by ESP_Sprite
For what it's worth: the reason is that the partition table is not safe to rewrite on the fly: if the partition table gets corrupted because someone switched off the ESP during the write, it can render the chip unbootable.

Re: Create a partition in code

Posted: Fri Jan 19, 2024 7:02 am
by chruge
Dear all

Thank you for the clarification.

I'm not sure where to make that suggestion... or maybe it's stupid anyway.

With OTA there is a similar integrity issue and it has been solved with the ota data partition and two ota partitions. Could that mechanism be used here too?

Regards

Chris

Re: Create a partition in code

Posted: Sat Jan 20, 2024 1:23 am
by ESP_Sprite
It could, but it's not currently implemented.