Hi all, I am working on the embedded file system (EFS) using the Keil version 6.11.0. In the current project, I am logging test data in the flash file system memory continuously. I have encountered a problem after a certain period of testing, where the file system is trying to write in the space which is already previously written by the file system (this memory space already has data). As for how the way flash works, file system would have to clear the flash memory before writing in the space. But that does not happen. This leads to the flash file system making the data (allocation data as per debugging) invalid for the files in the flash space.
The image below shows the memory view of the flash, during debugging this problem. The left part of the image shows the flash memory before the write and the right side shows after programming the data.So next time I try to open/write/read a file an allocation error is generated which I am checking the drive using the fcheck. Following this, I format the drive using fformat. So when I use the fformat, it erases all the flash sectors. Hence, I lose all the data.I am not sure how can the file system behaviour be rectified so that it does not generate the error in the first place. I don't think there would be a method to find which data is valid in the files so that particular data can be saved. If yes, do let me know.Additionally, is there a File System Validation suite available? I can use that to validate the general Embedded File System (EFS) behaviour.Thanks for your help!