Microchip-MPLAB-Harmony / core

Harmony 3 Core
https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MH3_core&redirect=true
Other
17 stars 12 forks source link

SD Card performance with different read buffer size ( SYS_FS_FileRead ) #32

Open ajefr opened 1 year ago

ajefr commented 1 year ago

Hello, I'm facing a strange behaviour while using the SYS_FS_FileRead function. I have one file to read. If I read it with a 512 byte buffer, read time is correct (70 seconds). If I read it with a smaller buffer, read time increase a little bit (77, 80 secs). But if I try with a 1024 bytes buffer, the read time is catastrophic : maybe 20 minutes !

code is a "do while end of file" with this read function : nBytesRead = SYS_FS_FileRead( fileHandle, (void*)read_buffer, buff_size); buff_size was tested with 256 / 512 / 1024 Obviously, read_buffer has the correct size for handling the bytes amount.

How can it be possible ?

Thanks