Create a partition in code

chruge
Posts: 15
Joined: Fri Jul 21, 2023 8:06 am

Create a partition in code

Postby chruge » Fri Oct 27, 2023 11:36 am

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

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Create a partition in code

Postby mbratch » Mon Oct 30, 2023 1:17 pm

I found this with a little searching. Is this helpful?
ESP32: Partition Table Update Through OTA

chruge
Posts: 15
Joined: Fri Jul 21, 2023 8:06 am

Re: Create a partition in code

Postby chruge » Mon Jan 15, 2024 12:57 pm

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

ESP_adokitkat
Posts: 52
Joined: Thu Jun 22, 2023 12:50 pm

Re: Create a partition in code

Postby ESP_adokitkat » Mon Jan 15, 2024 2:35 pm

Hello. There in no official higher-level API for this at the moment.

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: Create a partition in code

Postby ESP_Sprite » Tue Jan 16, 2024 1:26 am

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.

chruge
Posts: 15
Joined: Fri Jul 21, 2023 8:06 am

Re: Create a partition in code

Postby chruge » Fri Jan 19, 2024 7:02 am

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

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: Create a partition in code

Postby ESP_Sprite » Sat Jan 20, 2024 1:23 am

It could, but it's not currently implemented.

Who is online

Users browsing this forum: Bing [Bot] and 88 guests