Esp32S3 : Why time to write in Flash is so long ? Help !
Posted: Mon Jan 29, 2024 10:54 am
Good morning,
I am using an Esp32S3 and I have a problem when writing something in Flash memory.
Could you please help me ?
1) 1st thing I have done :
I defined a partition type FAT in flash memory.
I mounted a FileSystem (Type FAT FileSystem) on this partition using Virtual File System component.
My goal was to write something (10 bytes) in a file as fast as possible.
The problem I saw was that in order to write something in my file, I had to open it, write something in it and close it.
I didn't manage to flush the things I had write without closing the file. And all these operations (Open, write, close) tooks
something like 2 seconds. This was too much time for the application.
Question 1 : Do you know why it tooks 2s to write 10 bytes in my file in this case please ?
Question 2 : Have you already managed to flush the things you had writen in a file without closing it (Using FAT FileSystem and VFS component) ? This would enable me to write things in my file without opening and closing it. => Maybe it would be faster ?
2) The second thing I have done :
Because this operation tooks too much time, I decided to write the 10 bytes in an NVS.
So, I have created a special partition, I have mounted an NVS on the partition and I am using the set_blob methods in order to write the 10 bytes in the partition. The amount of time needed by this operation is sometime 150ms, but sometime 4700ms.
I have 2 other NVS opened on two other partitions.
Could you please explain me why it takes this big amount of time in order to write something on my NVS please ?
Maybe the solution would be to write things in a file again but flushing the datas in it instead of opening and closing
the file each time. Have you already done it ? Do you have any example please ?
Thank you for your help, this is really important.
I would like to write my 10 bytes of datas in about 150ms each time.
Do you have any idea please ?
Best regards,
Thomas TRUILHE
I am using an Esp32S3 and I have a problem when writing something in Flash memory.
Could you please help me ?
1) 1st thing I have done :
I defined a partition type FAT in flash memory.
I mounted a FileSystem (Type FAT FileSystem) on this partition using Virtual File System component.
My goal was to write something (10 bytes) in a file as fast as possible.
The problem I saw was that in order to write something in my file, I had to open it, write something in it and close it.
I didn't manage to flush the things I had write without closing the file. And all these operations (Open, write, close) tooks
something like 2 seconds. This was too much time for the application.
Question 1 : Do you know why it tooks 2s to write 10 bytes in my file in this case please ?
Question 2 : Have you already managed to flush the things you had writen in a file without closing it (Using FAT FileSystem and VFS component) ? This would enable me to write things in my file without opening and closing it. => Maybe it would be faster ?
2) The second thing I have done :
Because this operation tooks too much time, I decided to write the 10 bytes in an NVS.
So, I have created a special partition, I have mounted an NVS on the partition and I am using the set_blob methods in order to write the 10 bytes in the partition. The amount of time needed by this operation is sometime 150ms, but sometime 4700ms.
I have 2 other NVS opened on two other partitions.
Could you please explain me why it takes this big amount of time in order to write something on my NVS please ?
Maybe the solution would be to write things in a file again but flushing the datas in it instead of opening and closing
the file each time. Have you already done it ? Do you have any example please ?
Thank you for your help, this is really important.
I would like to write my 10 bytes of datas in about 150ms each time.
Do you have any idea please ?
Best regards,
Thomas TRUILHE