I have integrated the ChaN FatFs R0.09b into a project running on a Hercules RM48L952-based module of our own design On rare occasions, writes to the micro SD card will hang/freeze. This seems to occur when calling f_unlink, f_write, or f_open commands. There are low level loops within the FatFs that could continue forever if the status never changes to FR_OK.
This code was originally ported from "RM48 HDK RevE SDCard Demo" with very few changes. One change was to change the SPI2 to SPI1 needed for our hardware module. Another was to light an LED when the micro SD is being accessed.
I have a few questions:
1.) Is R0.9b the best version of the ChanN FatFs to use? Are there any know problems with this version such as freezing up during micro SD card accesses?
2.) Could this be the result of the micro SD card wearing out from over use? We write to the card about every 8 minutes. But these cards have been in used for less than a year.
3.) We are in an electrically noisy environment (480VAC 3-Phase being switched with an SCR). If the SPI interface was disrupted due to noise spikes, could that be a root cause of a freeze?
Any help would be much appreciated. Thank you.