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

WDT: store debug data for reboot

Hi,

I have an unkown problem in my nrf52 application. It happens rarely, so I have no idea where to look at the moment. The only thing I know is that the WDT works and resets the device (looking at RESETREAS register). 

My idea would be to store some debug data (i.e. some sort of id so I know what the last checkpoint or called function is). 

First I tried to use the GPREGRET register to store this kind of data, but WDT reset will reset this register.

After that I tried to store the data to flash as soon as wdt_event_handler is called. This does not work either, I guess because the max amount of time I have in WDT interrupt is two cycles of 32768[Hz] clock.

So my question is: how can I persist debug data efficiently and read it after WDT reset?

Related