Hello all,
What is the best way to use non-user-serviceable memory cards with file sys= tems in embedded systems that can lose power at any time? The way I see it,= there are two problems that need to be addressed:
1 - File system corruption due to sudden power loss immediately after the f= ile system has erased a sector on a device. 2 - File system fragmentation (especially if you're not running an OS like = Linux. and so don't have access to defragmentation software. In my case, my= firmware is on the metal).So far, I can only think of the following ways to solve the above two probl= ems:=20
1 - Regarding the power supply issues, either use a UPS so that the system = is never turned off, or have a short term backup supply that can provide en= ough power for the system to safely close all file handles and write everyt= hing it needs to the memory card after it detects that main power has been = lost. 2 - Regarding the fragmentation issues, the system could be programmed to r= egularly reformat the memory card at suitable times (e.g. for my applicatio= n, a remote datalogger, once all the data files have been successfully sent= to the server).What other problems would one need to address when using memory cards and f= ile systems in embedded systems, and how would one overcome them?
Regards,
Amr Bekhit