Let's say I have a flash memory that has a 100,000 write cycle endurance. Each segment is 512 bytes, and as usual has to be erased fully to be rewritten to.
If I want to save the amount of elapsed seconds (and therefore perform a write cycle each second), I will have to start using an other segment after every 100,000 seconds. This means that after 10 years, I would have used 3165 different segments - or 1,615,872 bytes of memory - for that purpose only.
Is there a more efficient way to store a second counter into flash memory?
Is using flash memory for this purpose simply a bad design choice? I'd like to use the internal flash of my MCU instead of adding external memory, but if the latter is a more sane idea, please still propose.
PS. I cannot use RAM because my MCU could be shut down at any given time. Seconds need to be safely stored in non-volatile memory.