Page 1 of 1

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

Posted: Mon Apr 14, 2025 2:22 pm
by ThomasESP32
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.

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

Posted: Mon Apr 14, 2025 5:36 pm
by ThomasESP32
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 ?

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

Posted: Tue Apr 15, 2025 8:17 am
by MicroController
Or is there a way to protect the filesystem against power lost ??
Yes, LittleFS.

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

Posted: Wed Apr 16, 2025 6:36 am
by ThomasESP32
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