Hello All.
We're looking into beginning development on an ARM7 based platform, and we are thinking about using an attached SD-card for storing environmental log data.
I've noted that "All files opened for writing must be closed before the memory card is removed from the socket. Otherwise, a FAT file system might be corrupted." as per the instructions on Keil's website, but my question is:
If a system has not closed files it is writing to on the SD-card using a FAT file system, and a power loss occurs, will/can the file system also be corrupted in such a case? I'm assuming yes?
any thoughts on this? is it a bad idea in general to use a FAT file system in a system that very well could expect power loss at any time?
Thank you.
Unfortunately I have a lot of bitter experience with this matter. On our current systems that are still ARM7 based, power failure handling is done by saving critical data to a NAND flash. I can write up to 23[KB] within 25[milliseconds] or so (even that seems to cause rare problems but that might be due to the blocking nature of the interrupt system of the ARM7 - the code is solid). We do have problems with SD card corruption, probably due to some file not being closed on time (remember that the buffers must be flushed) and Keil's arbitrary DMA timeout settings that have caused SD card (even industrial grade) to get completely corrupted thanks to sector 0 failure. My advise? Use anything but FlashFS for time critical logging.
Point well taken, Tamir. Thanks for your reply.
we'll proceed with caution.