How do I create new partition when running App code?

Charles_Wen
Posts: 13
Joined: Fri Aug 06, 2021 1:39 am

How do I create new partition when running App code?

Postby Charles_Wen » Fri Feb 03, 2023 11:31 am

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?

cruvus
Posts: 59
Joined: Fri Jul 08, 2022 5:08 pm
Location: Planet Earth

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

Postby cruvus » Fri Feb 03, 2023 3:53 pm

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).
ESP32 / ESP-IDF 5.1.4

tpbedford
Posts: 31
Joined: Mon Feb 14, 2022 4:16 am

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

Postby tpbedford » Wed Feb 08, 2023 3:45 am

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.

Who is online

Users browsing this forum: markkuk and 335 guests