lpcware

FR_DISK_ERR issue in f_write() for chan's FATFs

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by arvind.k08 on Fri Aug 28 06:16:34 MST 2015
Hello,



I am using chan's FatFs for writing my logs on sdcard (Sandisk ultra 8gb, class 10). Interface used is SD card interface.

I am getting around 900 float values to write on sd card.



I am writing logs to the sd card each second(each second 900 float values are being received).



Before doing f_write(), I am doing sprintf() for the float values and converting the float values to char string.

I am converting 90 float values to char string at a time in a for loop and the char string is being passed to f_write() to write on sdcard.

It is writing to sdcard also but sometime f_write is failing with FR_DISK_ERR putting me vulnerable to miss data.



Please suggest why this FR_DISK_ERR is happening and how can i avoid it to get proper writing on sdcard without missing data.

Outcomes