Thank a lot zafer!!, but unfortunately i considered that option before and cannot do that. The Flash mem has only 1000000 writes per page, so if i need to save a state flag there this must be written every time i write the A&D. In result, if i do this my equipment will not live too much. There is another path to solve this, instead of manage a flag in FLASH you can use the “Finalize” flag of the CELL. Lets say you have 10 CELLS whose sizes are defined, so you write in the first CELL till fill it, and then you write then next and so, later you begin to Read from the first one, once you finish reading and move to the nex one, you Finalize that CELL (doesn mather if you have the CELL size defined, you can still finalize it) and then remove it. If the power fails and your app cant erase the cell the cell wont be freed, so when your app restarts just check for finalized Cells and erase it.
1-Make the CELLS with the defined sizes.
2-Write and read them as you please.
3-When your want to erase the Cells, you “paint” them with the Finalize command.
4-If you need to restart or the app is interrupted, the first thing to do is to erase the Finalize Cells.
With this method you dont need to use the Flash mem to know wich Cells have to been erased. I tested this one and it works!.