Esp32S3 : Time to rename a file or remove a file on the Internal Flash is a bit long.

ThomasESP32
Posts: 282
Joined: Thu Jul 14, 2022 5:15 am

Esp32S3 : Time to rename a file or remove a file on the Internal Flash is a bit long.

Postby ThomasESP32 » Mon Apr 14, 2025 2:22 pm

Good afternoon,

I am working with an Esp32S3 and I have mounted a filesystem using VFS on the internal flash of the chip.
The size of the filesystem is about 1Mo and I record some files on it (Let's say some tmp files).

Every X minutes, my program is doing some filecleaning on this filesystem and loops
on the files in order to :
- Rename them.
- Erase them.

The problem is that the time needed to rename a file is something like 300ms and the time needed to remove a file is something
like 900ms.

If the power is lost during the cleaning of these files and the card is shutoff, it seams that the filesystem is totally crashed.
All the files are lost and if I read the filesystem I can see some files called :
- ?????????.??????? or things like that.

Is there a way to speed up file rename or fileerase on the chip ?
Or is there a way to protect the filesystem against power lost ??

Thank you for your help,
This is really important.

ThomasESP32
Posts: 282
Joined: Thu Jul 14, 2022 5:15 am

Re: Esp32S3 : Time to rename a file or remove a file on the Internal Flash is a bit long.

Postby ThomasESP32 » Mon Apr 14, 2025 5:36 pm

Just for your information, I use the C methods rename and remove
to remove and rename the files.

The min shutdown time is 700ms so it would be a good thing if the remove time of a file
or the rename time of a file was less than 700ms.
The rename time seems to be 300ms, so it should be ok.
But the remove time is something like 900ms or 1s....

Do you have any idea please ?

MicroController
Posts: 2705
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Esp32S3 : Time to rename a file or remove a file on the Internal Flash is a bit long.

Postby MicroController » Tue Apr 15, 2025 8:17 am

Or is there a way to protect the filesystem against power lost ??
Yes, LittleFS.

ThomasESP32
Posts: 282
Joined: Thu Jul 14, 2022 5:15 am

Re: Esp32S3 : Time to rename a file or remove a file on the Internal Flash is a bit long.

Postby ThomasESP32 » Wed Apr 16, 2025 6:36 am

Hello,

do you think Little FS totally protects Filesystem from being corrupted when the power is lost ?
Do I have the possibility to mount some Filesystems using FatFS and others using Little FS using Virtual Filesystem above them ?

Thank you for your help ,

best regards,


Thomas TRUILHE

Who is online

Users browsing this forum: No registered users and 1 guest