Hi,
I have a battery powered device which goes to system off mode when it is not used. I want to do some stuff when the battery is inserted the very first time after production (it cannot be replaced by the user, so the device stays powered for its whole lifetime).
For that reason I check RESETREAS at startup. When none of the flags is set, I assume it is coming from POR which means the battery was just inserted. When the OFF flag or the DOG flag (or any other) is set, I assume the device was already running before.
I noticed that I have to clear the flags after reading them as they are still set at the next start up, which made me wondering whether I can trust that all flags are cleared when the nRF51 is powered the very first time?
Thanks for your help