Page 1 of 1

How do I create new partition when running App code?

Posted: Fri Feb 03, 2023 11:31 am
by Charles_Wen
I need create new partition when running App code. Because the new version firmware need a "storage" partition used for SPIFFS, the old firmware didn't create this partition. And the products which burned the old firmware could only update the firmware by OTA. So I want to create new partition in App code. Can this idea be implemented?

Re: How do I create new partition when running App code?

Posted: Fri Feb 03, 2023 3:53 pm
by cruvus
I am looking for the same feature. I need it for the core dumps. Unfortunately, to save them to flash, there is no other way but a special "core dump" partition. The devices are in the field, so I cannot use esptool on them (and I cannot use uart for core dump either).

Re: How do I create new partition when running App code?

Posted: Wed Feb 08, 2023 3:45 am
by tpbedford
if esp_partition_find() does not find your partition, could you simply populate a esp_partition_t struct with the address of a known empty area, and pass that to any file system functions? I've never tried it myself, but it might work. Probably not for core dumps though because you aren't actually modifying the partition table.

You might first need to format/verify the area yourself, although there are probably esp library functions for that.