Could I trigger nRF52832 to do soft reset when watchdogs timer timeout?
Could I trigger nRF52832 to do soft reset when watchdogs timer timeout?
I have seen the watchdog example. But I don't know what do you mean about "It's not the correct way of using the watchdog". Do you see any problem from my attache files?
It shouldn't be necessary to manually reset when the watchdog expires, that would defeat the whole purpose of having a watchdog. The watchdog should schedule a reset once it expires independently of the CPU. If you were dependent on the CPU reaching some state to do a reset when the watchdog has expired then the watchdog wouldn't be that useful.
But my question is why watchdog event handler _wdtEventHandler() is not called. Could you explain about this?
<info> WDT: Function: nrfx_wdt_init, error code: NRF_SUCCESS.
0> <info> WDT: Function: nrfx_wdt_channel_alloc, error code: NRF_SUCCESS.
0> <info> WDT: Enabled.
0> <debug> app: Watchdog timer feed
0>
0> <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at ..\..\..\..\..\..\com<error> app: End of error report
Can I use NRF_LOG_WARNING() to check if watchdog event handler _wdtEventHandler() is called? Or I need to use LED to check if watchdog event handler _wdtEventHandler() is called?
I am sure watchdog event handler _wdtEventHandler() is called by checking with LED. But why main() isn't called after calling NVIC_SystemReset().
int main(void) {
log_init();
uart_init();
_showInfo();
...
}
static void _showInfo(void) {
NRF_LOG_INFO("Version %d.%d.%d\n", MAJOR_VER, MINOR_VER, PATCH_VER);
}
I only " app: Version 1.0.0" one time in following log messages. It should be two times if main() is called after system reboot.
0> <info> app: Version 1.0.0
0>
0> <info> app: ========| flash info |========
0> <info> app: erase unit: 4096 bytes
0> <info> app: program unit: 4 bytes
0> <info> app: end address: 0x7FFFF
0> <info> app: ==============================
0> <info> app_timer: RTC: initialized.
0> <debug> app: NOR_DATA_PERIOD=819
0>
0> <debug> app: NOR_RECORD_PERIOD=8192
0>
0> <info> app: bsp_button_longkey_handler 0.
0> <info> app: POWER_ON.
0> <info> app: External devices initializing start
0> <info> app: Reg 0 20
0> <info> app: Reg 9 A
0> <info> app: Reg A D
0> <info> app: Reg 1 B
0> <info> app: Reg 2 D
0> <info> app: Reg D F
0> <info> app: Reg E 13
0> <info> app: Reg 36 10
0> <info> app: Reg 37 13
0> <info> app: Reg 5 11
0> <info> app: Reg 6 13
0> <info> app: Reg F 15
0> <info> app: Reg 10 19
0> <info> app: Reg 3 16
0> <info> app: Reg 4 19
0> <info> app: Reg 7 17
0> <info> app: Reg 8 19
0> <info> app: Reg 11 1B
0> <info> app: Reg 12 1F
0> <info> app: Reg 43 0
0> <info> app: Reg 44 0
0> <info> app: Reg B 1D
0> <info> app: Reg C 1F
0> <info> app: Reg 13 21
0> <info> app: Reg 14 25
0> <info> app: Reg 1D 3F
0> <info> app: Reg 64 0
0> <info> app: Reg 65 27
0> <info> app: Reg 66 0
0> <info> app: Reg 67 27
0> <info> app: Reg 68 0
0> <info> app: Reg 69 27
0> <info> app: Reg 52 2C
0> <info> app: Reg 53 2C
0> <info> app: Reg 6A 32
0> <info> app: Reg 6B 38
0> <info> app: Reg 1E 101
0> <info> app: Reg 20 3
0> <info> app: Reg 21 2
0> <info> app: Reg 22 802084
0> <info> app: Reg 23 124218
0> <info> app: Reg 4B F
0> <info> app: Reg 50 18
0> <info> app: Reg 31 20
0> <info> app: Reg 39 5
0> <info> app: Reg 4E 0
0> <info> app: Reg 4E 8
0> <info> app: Reg 45 8
0> <info> app: Reg 46 13
0> <info> app: Reg 47 14
0> <info> app: Reg 48 1F
0> <info> app: Reg 0 21
0> <warning> app: nrfx_wdt_init() return 0
0>
0> <info> app: External devices initializing finish