Michael
In the uTasker project there is a method called "PARAMETER_AREA" which corresponds to your requirements. It will allow the K22 Flash to be modified 10 million times by defining 2 flash sectors for the storage (or 20 million for 4 sectors, etc.). Same for KV parts.
You can do the same very simply for storing a time value as follows:
1. Define 2 sectors of 4k for the operation
2. Each time you start, search through the area to find the 'last' value, which is the valid one
3. Each time you write, write just a long word or phrase (depending of Flash type) to the "end" of the list.
4. During step 2, if the last value is in the second flash sector, delete the first (to make space for its use again)
5. If in step 3 the second flash sector is full, write the new value at the start of the first sector
6. During step 2, if the last value is in the first sector and the second sector is not blank, delete the second sector
I may have missed a detail or two but the principle should be clear.
The new life expectancy is calculated by:
Number of writes in a 4k sector (assuming phrase writes) is 4k/8 = 512
Giving effectively 10k x 512 update cycles for the sector = 5'120k writes
Due to the two sectors (acting as a swap block to retain the newest value while the older ones are deleted) this doubles to 10'240k
Using multiple sectors again increases the effective 'changes' that can be made to the time value.
In the "PARAMETER_AREA" operation a set of parameters can also be saved, with the lifetime reducing according to the block size that needs to be written each time, but the basic operation is the same.
Regards
Mark