AnsweredAssumed Answered

STM32F10x + FATFS + SDIO

Question asked by Nikhil Ingale on Sep 19, 2016
Latest reply on Sep 23, 2016 by Nikhil Ingale
Hi,

I am working on SDIO(Sandisk 32Gb class 10 sd card) + FATFS. My application code contains two loops one is 50Hz and other is of 1Hz. I am writing 512 bytes in 50Hz loop(i.e. after 20ms delay, flag is becoming true in sysTick handler) and f_sync at 1Hz (calling f_sync to avoid any accidental data loss).

Normally loop rate is fine 46-50 but exactly after 660 seconds my 50Hz loop is dropping to 20/23/17 etc(i have used one counter in 50Hz and the same is stored as one of the parameter on SD card, which is plotted to see the results).

I formatted the SD card with 8k,16k,32k cluster size but i am getting the same results.
Even i tried to increase the number of bytes to 1024,2048 (multiple sectors ) etc and called f_write after 40ms / 100ms. But results are same with loop rates such as 18/20/22 etc exactly after 660 seconds.

Along with this i am also logging the f_sync and f_write timings in milliseconds on SD card, normally it is 7-9ms which is acceptable as it is not hindering my 50Hz loop but exactly after 660 seconds its write time is going to 400ms-450ms.

For exercise purpose i wrote the 512Bytes at 25Hz which gave me the loop rate around 48-50 which is really very good, But then i tried 1024 at 40ms,with this loop rate was dropped to 20/18/23 etc.

I want to write 1024 bytes at 50Hz. Is it possible with the kind of behavior and the kind of application which is explained above?

I have attached the resulting image for reference.

Thanks...!!!

Attachments

Outcomes