A method for writing into a flash memory device includes calculating a
physical block for writing data thereto, checking whether the calculated
physical block has been erased since a last power-up of the device and if
it has been erased writing the data, or, if it has not been erased
performing a refresh operation thereby obtaining a newly erased block
since a last power-up that the data can be written to. The newly erased
block may be the calculated block or another block of the flash memory.