Page 1 of 1

Esp32S3 : Is it possible to improve the record time in Flash using vfs component ?

Posted: Tue Apr 09, 2024 2:16 pm
by ThomasESP32
Good afternoon,

I am using an Esp32S3 in order to receive a file over BLE and write it in the internal Flash of the chip :

- Each frame received over BLE is 237 bytes.
- Each frame received is written in Flash (So 237 bytes are written each time in flash).

In order to do that, the filesystem has been declared/opened using vfs component and the sector size is 512 bytes.

I think that the record time of the entire file is a bit long. Do you think it would be smaller if I wrote 512 bytes each time in Flash ?

Do you know if the vfs component writes a sector size each time ???

Thank you for your help,

Best regards,

Thomas TRUILHE

Re: Esp32S3 : Is it possible to improve the record time in Flash using vfs component ?

Posted: Wed Apr 10, 2024 11:58 pm
by djixon
How large are those files you are sending over BT in chunks of 237 bytes?
If a single file can fit into IRAM or PSRAM then better fetch it there first (if you think flash speed is issue slowing down already slow BT transfer). Once file is received into ram, you can store it asynchronicaly into flash in some background task and freeing that ram.

Re: Esp32S3 : Is it possible to improve the record time in Flash using vfs component ?

Posted: Fri Apr 12, 2024 9:21 am
by ThomasESP32
Sorry, but my question is not good.

It should be : Do you know how "the writing" of a file in a FileSystem mounted on the Internal Flash of the chip is done ?

Let's imagine I have a mp3 file with a size equal to 150Ko in PSRAM (In a buffer).

Is it faster to write it in Internal Flash (with a FileSystem mounted using VFS) by chuncks with size equal to a sector (512 bytes) ?
Or can I choose the size of chuncks I want (For example 237 bytes).

Thank you for your answer.
Best regards,

Thomas TRUILHE

Re: Esp32S3 : Is it possible to improve the record time in Flash using vfs component ?

Posted: Mon Apr 15, 2024 11:50 am
by ESP_adokitkat
Hello.

Could you please specify which filesystem (FATFS, SPIFFS, LittleFS, ...) are you using? As storage media you are using internal flash, is that right? Also which ESP-IDF version are you using?

I would recommend using using LittleFS as it is actively developed and maintained, made for embedded devices as well as being more resistant to corruption than FATFS (while power-loss). Here is a small benchmark in the official repository: https://github.com/joltwallet/esp_littl ... 88kb-files and here you can find example code in ESP-IDF repository: https://github.com/espressif/esp-idf/tr ... e/littlefs

Re: Esp32S3 : Is it possible to improve the record time in Flash using vfs component ?

Posted: Wed Apr 17, 2024 12:14 pm
by ThomasESP32
Hello,

I am using FatFS to work with my files. The FileSystem is mounted on the internal SPI Flash.
I would like to keep FatFS please.