This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SD Card RL-FlashFS - Power Loss?

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.

Parents
  • You misunderstood me. I never talked about hiding any file system within a single file in the FAT file system.

    I talked about storing raw binary data (for example measurements) within a preallocated FAT file of fixed size, to make sure that there are no FAT chains that may break in case of a power loss.

    Most image formats don't care if the file in the file system is much larger than the actual image data.

    But quite a lot of embedded equipment don't need to store images but need instead to store captured measurements. And in many situations it's ok to have binary files on the memory card that requires a special PC program to extract the data. The PC sees files in a FAT file system, so you don't need to worry about any drivers to extract your "measurements1.dat". And if a power loss results in "measurements1.dat" being broken, you can normally save the day by instead retrieving the "measurements2.dat" file instead.

    If you did not have a FAT file system, then your PC would think the memory card was broken or unformatted if you put it in the PC. That is way worse than finding one or more files of fixed size and having a Windows program process the memory card contents into other formats.

Reply
  • You misunderstood me. I never talked about hiding any file system within a single file in the FAT file system.

    I talked about storing raw binary data (for example measurements) within a preallocated FAT file of fixed size, to make sure that there are no FAT chains that may break in case of a power loss.

    Most image formats don't care if the file in the file system is much larger than the actual image data.

    But quite a lot of embedded equipment don't need to store images but need instead to store captured measurements. And in many situations it's ok to have binary files on the memory card that requires a special PC program to extract the data. The PC sees files in a FAT file system, so you don't need to worry about any drivers to extract your "measurements1.dat". And if a power loss results in "measurements1.dat" being broken, you can normally save the day by instead retrieving the "measurements2.dat" file instead.

    If you did not have a FAT file system, then your PC would think the memory card was broken or unformatted if you put it in the PC. That is way worse than finding one or more files of fixed size and having a Windows program process the memory card contents into other formats.

Children
No data