This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to recover calendar data after a reset

Dear Nordic Developer Zone,

I have implemented a real-time-clock using application timer which is based on the on-chip real-time counter on NRF51822.

A concern of mine is that after a reset due to a unpredictable error( i.e. stack error), is there a way to recover the previous time information?

Thanks, Tony

  • You might need to adjust the RAM settings in the compiler to have some uninitialized RAM. Most compilers will zero the main block of variables, but addresses declared VOLATILE may not be cleared by the compiler. If volatile or similar keyword isn't supported, then check if you can adjust the RAM definitions so a few addresses at one end of RAM block are not in the initialized variable RAM block

    • may need to be absolute addresses\
    • add the CRC as Clem suggests (even a CRC8 from a table lookup is better than no CRC).
Related