wdt Abnormal reset system

I am experiencing system resets caused by the WDT (Watchdog Timer) while using the nrf52832。

This is my WDT configuration code:

void system_wdt_init(void)
{
  uint32_t err_code = NRF_SUCCESS;
  nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG;

  config.behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT;
  err_code = nrf_drv_wdt_init(&config, wdt_event_handler);
  APP_ERROR_CHECK(err_code);
  err_code = nrf_drv_wdt_channel_alloc(&m_channel_id);
  APP_ERROR_CHECK(err_code);
  nrf_drv_wdt_enable();
}

I have set the WDT to stop during system sleep, but my system still gets reset by the WDT, though it takes a very long time—approximately 2 hours. Then the system gets reset by the WDT. My system uses an RTC, and I use RTT to print logs. During this period, the J-Link remains connected. I suspect whether the WDT reset is caused by the J-Link RTT or the RTC. I have already performed the feed dog operation immediately upon system wake-up.

  • Connected J-Link for RTT does not allow the system to go "idle" - it has to keep HF clock running in order to make the SWD connection work at all.

    No idea what the default WDT timeouts numbers are. They are probably just configured elsewhere in the config header.

    You probably want to feed the WDT at regular intervals even when idle.

  • hello

    After disconnecting the J-link connection, the WDT still resets the system. Once my application is executed, the system enters sleep mode. I am using the System ON sleep mode because I need to prevent the system from restarting. In the main loop of my application, I perform the watchdog feeding operation, and the execution of one full cycle of my main loop definitely does not exceed 3 seconds. The watchdog timeout is set to 3 seconds. I can confirm that after the system enters sleep mode, my application does not actively wake up the system. Only the RTC compare interrupt wakes up the system every two hours. However, I also perform the watchdog feeding operation in the RTC interrupt service function, and I feed the watchdog immediately after executing nrf_pwr_mgmt_run(), meaning the watchdog is fed as soon as the system wakes up. The current observation is that after the system enters sleep mode and no application code is executed, the system is reset by the watchdog after a long time, approximately several hours.

  • Hi h_544364,

    How did you check that the feeding is actually done once under 3 seconds reliably? 

    Did you, for example, print out a log at the same time as feeding?

    How do you time when something happens in your project?

    Hieu

Related