cancel
Showing results for 
Search instead for 
Did you mean: 

EFSL and battery backup SRAM?

pm9341
Associate II
Posted on May 07, 2008 at 12:28

EFSL and battery backup SRAM?

5 REPLIES 5
pm9341
Associate II
Posted on May 17, 2011 at 09:52

Has someone worked on avoiding filesystem corruption?

What can be made?

Please comment.

daniel8
Associate II
Posted on May 17, 2011 at 09:52

Well, unless you have a backup battery (or a very early warning that the system is about to lose power, you are kinda SOL).

What you can do however, is call fs_flushFs(&efs) - that will write the FAT table, and at least get you your files up to that point.

pm9341
Associate II
Posted on May 17, 2011 at 09:52

Yes i have a battery backup.

Maybe i can write the &efs to a own section and call fs_flushFs(&efs) after power up.

pm9341
Associate II
Posted on May 17, 2011 at 09:52

made a try and cannot flush, must first efs_init() to initilaze the SD card and then i lose backed up data.

daniel8
Associate II
Posted on May 17, 2011 at 09:52

fs_flushFs will write the contents to the FAT table, but you can't do that after the powerup - you need to do that BEFORE the power down. (I am assuming you are trying to preserve whatever files you had opened you were writing to the moment that you lost data).