-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TW#17077] SDCard format leads to speed decrease #1382
Comments
That probably has to do with the allocation unit size set to sector size in res = f_mkfs(drv, FM_ANY, s_card->csd.sector_size, workbuf, workbuf_size); According to the FATFS manual, "The value must be power of 2 and between the sector size and 128 * sector size". Setting the allocation unit equal to 64kB will result in the best performance. |
|
It does make sense to make the allocation unit size configurable through |
Thanks for the hint on FM_SFD. I removed this flag. |
* Additional partition scheme min_spiffs with minimal SPIFFS partition size and OTA support for bigger apps * Selectable (from menu) partitions for m5stack addition for m5stack (as is prepared for lolin32 board: espressif/arduino-esp32#1379) discourse here: espressif/arduino-esp32#1378
I have SD card using 4-line SD mode (SDMMC peripheral). SD is formatted under Windows 7 with exFAT (cluster 16k). I measured SD Card speed writing 1mb file in circle. The speed depends of buffer size, as expected. Results are:
1kb buffer: 0.3-0.4 Mb/s
2kb buffer: 0.6-0.9 Mb/s
4kb buffer: 0.9-1.9 Mb/s
8kb buffer: 1.0-3.8 Mb/s
16kb buffer: 1.4-4.1 Mb/s
If I format SD using esp32 than I have significant decrease of speed. The speed does not depend of buffer size:
1kb buffer: 0.14-0.16 Mb/s
2kb buffer: 0.14-0.16 Mb/s
4kb buffer: 0.14-0.16 Mb/s
8kb buffer: 0.14-0.16 Mb/s
16kb buffer: 0.14-0.16 Mb/s
FATFS configuration is:
I use the following format function:
FatFS is unmounted before calling format function. Just after format, Windows 7 can not read SD card. When I insert an adapter with SD card it is blinking endless, drive letter is appeared but system hangs on trying to open it. If esp32 formats SD card with FAT, the situation is the same. I used 5 different SD cards (2gb, 8gb, 32gb). To recover SD card I insert it into phone with android, format with FAT, than format with exFAT under Windows.
The text was updated successfully, but these errors were encountered: