My project is running on an nRF52832 with the soft device enabled. At the start of my project I have the following
uint32_t reset_reason;
sd_power_reset_reason_get(&reset_reason);
sd_power_reset_reason_clr(0xFFFFFFFF);
printf("reset reason %X \n ", reset_reason);
nrfx_wdt_config_t config;
config.behaviour = NRF_WDT_BEHAVIOUR_RUN_HALT; // wdt will pause during SLEEP mode (typically when nrf_pwr_mgmt_run is called)
config.reload_value = WDT_DURATION_MS;
config.interrupt_priority = 2; // highest priority. If the wdt expires it will override whatever is happening
err_code = nrfx_wdt_init(&config, wdt_handler);
APP_ERROR_CHECK(err_code);
err_code = nrfx_wdt_channel_alloc(&m_channel_id);
APP_ERROR_CHECK(err_code);
nrfx_wdt_enable();
When I reset the system our normal way (calling nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF) with a gpio interrupt configured, then triggering the gpio) I get 0x35831 which includes reset reasons RESETPIN, OFF, DIF, and NFC. When I force the wdt to expire (by never feeding it) my reset reason is still 0x35831. When triggering the reset via GPIO the RESETPIN and OFF flags make sense, but DIF and NFC do not. The lack of DOG reason when triggering reset via wdt is also confusing.
My questions are as follows:
1. Am I retrieving, and more importantly clearing the RESETREAS register correctly?
2. Why does DOG not appear in RESETREAS when forcing the wdt timer to expire?
3. Why do the DIF and NFC flags appear in RESETREAS? I do have the device connected to an nrf52832 devkit serving as a debugger, but am not in debug mode, and we are not doing anything to configure NFC field detection.