I am working on a datalogger that writes positions from GPS to serial flash W25Q64FV. I plan to write GPS data every second. I have couple of questions:
- With this flash memory it is possible to write to any position from 1 to 256 bytes at once (page). Specification says the memory has 100,000 write/erase cycles. Is it counted per page or per byte? So if I write one byte at address X and then later another one at address X + 1 (but the same page) does it mean that I have only 99.998 writes left to that page? I would say no, but for sure I am asking. What if writing one byte internally rewrites complete page?
- How to persistently keep address of last written byte? I could write it to Arduino's EEPROM on every update, but it also has "only" 100,000 write cycles so this would be reached much sooner. Other possibility could be to scan all written memory and look for empty byte(s) but this can probably take a while. Or maybe just to have some bitmap in the flash header marking full pages and I would only scan the last one. Any other suggestion?
- Is there any special purpose of erasing blocks or complete flash memory? Can't I just write to memory in round-robin way? If I delete file on my HDD it won't write zeroes to all its bytes so couldn't it be same with flash?