Page 1 of 1

How to format fat filesystem?

Posted: Wed Jan 09, 2019 2:25 am
by YxWang
Hi there,

I found when write data to fat partition, power down will damage file. And the file will be locked to occupy a file size. I can't delete and write it. So I wont to format this partition. But I don't know how to do it.
Note :
I use wear_level api to create fat partition. And use wl mode is safety.

Thx!
Ye su

Re: How to format fat filesystem?

Posted: Wed Jan 09, 2019 3:49 am
by ESP_igrr
The simplest option is to call esp_partition_erase_range function to erase the entire partition. Then initialize WL and FATFS. This will result in the filesystem being formatted.

Re: How to format fat filesystem?

Posted: Wed Jan 09, 2019 9:11 am
by YxWang
ESP_igrr wrote:
Wed Jan 09, 2019 3:49 am
The simplest option is to call esp_partition_erase_range function to erase the entire partition. Then initialize WL and FATFS. This will result in the filesystem being formatted.
:D Thx.