Hi!
I am using SDK15 and I try to implement a clock feature. I have found some information about nRF52832, that RTC isn't a real time clock but a counter instead and it does not preserve its value through resets.
My application uses many alarms that ring when the time comes. :) To make them work I need some kind of independent timer running all the time, for example in epoch unix format (uint32_t seconds). With 32kHz RTC1 and PRESCALER = 4095 I am able to count up to like 24 days before buffer overflow but I would rather stop and start again my main timer every 7 days or 24 hours, doesn't really matter now.
Sometimes something bad may happen, a hard reset, a failure leading to crash and reset and so on. Is there a way I can retain my timer value? Suppose I don't know when the reset may happen, so I won't be able to save its value in flash memory just before (saving the value every second isn't an option, increased energy consumption and flash may wear out). I can't use any external clock module. Sending actual timer value to connected peer in case of crash/reset and getting it back afterwards is just too complicated and not reliable - there may be no peers connected.
Is there some kind of register where can I store some data to persist through resets? Or any other way to achieve what I try to accomplish? If it is important my device is battery powered.
Thanks