I had a strange thing when I append more data to the existing files, the previous data is lost! ( everybyte turn 0xff).
Here is how I did it:
I create a new file ( maximum size: 128K) which includes a header (8 bytes) records how many rows had been written. and I have data row each 50 bytes. each time I append 2~3 rows to the file.
the strange things is after I appended the new rows and updated the header, I read back to check the integrate but only found all the row except current written rows lost (turn 0xff),
I think it may related to the way how to write data to flash memory ( you need erase the section before writing it) because I updated the header. it may cause the underline api to erased the whole section.
If I have to include the header inside the file, what I should to do to avoid this issue? Thanks.