ruijc, But why are you required to erase all of the data? Why not just keep a couple of pointers? 1 for number of data bytes recorded and 1 for the next data location. The reason for 2 is to verify if either is corrupted. Just update the 2 pointers when writing the data or clear them when you require a memory clear function.

Dave Purola,
N8NTA