How to format fat filesystem?

YxWang
Posts: 23
Joined: Sat Oct 20, 2018 1:13 am

How to format fat filesystem?

Postby YxWang » Wed Jan 09, 2019 2:25 am

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: How to format fat filesystem?

Postby ESP_igrr » 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.

YxWang
Posts: 23
Joined: Sat Oct 20, 2018 1:13 am

Re: How to format fat filesystem?

Postby YxWang » Wed Jan 09, 2019 9:11 am

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.

Who is online

Users browsing this forum: No registered users and 325 guests