I'm using an nRF52832 (QFAAB0) on a custom PCB, nRF5 SDK, S132 v2.0.
I'm occasionally encountering spontaneous resets and want to tract down the source. I found the RESETREAS register and the SDK function to access it (sd_power_reset_reason_get). However, I think either I'm not using it correctly or something's going wrong. I have this code in main():
uint32_t reset_reason;
sd_power_reset_reason_get(&reset_reason);
printf("Reset reason = 0x%08x\r\n", reset_reason);
sd_power_reset_reason_clr(0xFFFFFFFF);
However, this always prints out a register value that makes no sense to me: usually something like 0x99bdae6c, which would indicate a ton of reset reasons (including NFC field detect -- I don't have an antenna connected!)
Are there any issues with the RESETREAS register in this device, or are there any examples available for proper usage?
EDIT: I learned that the resets are probably happening because of the BLE advertisement window timing out (i.e. my APP_ADV_TIMEOUT_IN_SECONDS value), if this makes a difference. Still, I'd like to know how to get that reported in RESETREAS.