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

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

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

Postby ThomasESP32 » Tue Apr 09, 2024 2:16 pm

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

djixon
Posts: 113
Joined: Sun Oct 01, 2023 7:48 pm

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

Postby djixon » Wed Apr 10, 2024 11:58 pm

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.

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

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

Postby ThomasESP32 » Fri Apr 12, 2024 9:21 am

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

ESP_adokitkat
Posts: 50
Joined: Thu Jun 22, 2023 12:50 pm

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

Postby ESP_adokitkat » Mon Apr 15, 2024 11:50 am

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

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

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

Postby ThomasESP32 » Wed Apr 17, 2024 12:14 pm

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.

Who is online

Users browsing this forum: No registered users and 75 guests