A technique is provided for detecting errors in persistent memory, such as
flash memory, where values of data items are stored at memory locations
added consecutively to one end of the already-allocated memory segment.
When a new location is added, a pointer to the address of the new
location is stored at the location of a preceding value for that item.
The address of the latest location is determined (21) whenever power is
reapplied. The pointer fields of the locations are searched (24) for any
pointer whose value is greater than the address of the last location. If
such a pointer value is found, this indicates that an error occurred when
writing the pointer value, for example because power was removed before
completion of the pointer writing cycle. The error can be corrected by
changing the pointer value to the address of the last location (27).