This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L952: ChaN's FatFs R0.9b on Hercules RM48 over SPI1 to micro SD card freezes occasionally

Part Number: RM48L952


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.

  • Hello,

    1. R0.09b FaTFs is used in this example. We didn't test this project with other rev of FaFts. 

    2. I don't know if the SD card is worn out. Any kind of flash memory has limited write cycles. Usually this is in the order of 100K write/erase cycles. Be aware of ESD, it might damage your card.

    3. The noise may affect the SPI clock, and disrupt the SPI communication. But I am not sure if the spike can damage the card.