Unable to change WDT reload value in FreeRTOS example.

Hi,

We had WDT added to FreeRTOS application with 24 hours timeout. This was working fine. But we tried to change it to 2 hours timeout and it is not working. It is still taking a 24 hours to reset the system with WDT. What could be the issue? I can see that nrf_wdt_started() returns true on reset in debugging. 

Tried the method mentioned in this thread. But still not working. Tried to change the reload value to 20 seconds and still not working. Any known workaround for this? How can I change it to a different reload value and release for new OTA firmware updates?


Thanks,
Vishnu Pradeep

Parents Reply Children
  • Got the issue. Only a sd_power_system_off or WDT reset can be able to change the settings again. Added sd_power_system_off and system reset in application flow to achieve this.

    Thanks

  • thanks for letting us know the fix Vishnu. Maybe we can close this thread now?

  • I tried the following flow. Basically after wdt enable.  just read the reload value using nrf_wdt_reload_value_get and then compare with WDT_CONFIG_RELOAD_VALUE. If not matching then restart the system using sd_power_system_off(); & sd_nvic_SystemReset(); . But for some reason this is not resetting the system. But if I explicitly do sd_power_system_off and sd_nvic_SystemReset by sending a command it is working as expeced. Any idea why the first method is not working?

    Or can you give a better solution.?

    Thanks,

    Vishnu

  • Hmm, let me see if I understand this correctly.

    You have an advertising issue which was the main reason to look into reset. And you looked in WDT as a workaround to reset the chip for that. And you see issues with the WDT with time and then you are using soft reset as a workaround to the issue to the WDT.

    I do not understand why your WDT issue is not working correctly. You need to debug that first by disabling everything else apart from the WDT feature. I have not seen WDT not functioning this way before.

    Vishnu Pradeep said:
    But for some reason this is not resetting the system. But if I explicitly do sd_power_system_off and sd_nvic_SystemReset by sending a command it is working as expeced.

    This is again workaround to a workaround and I do not know the context in which you are calling this. Why would you do system_off and system_reset at the same time? These two are different things. If you just want a reset, you should just call a sd_nvic_systemreset. And that should work.

  • Yes correct. We added WDT as a fail safe mechanism to restart the system if there is no BLE events for 24 hours. Later we tried to reduce the preload value to 2 hours and tried OTA and realised WDT is not resetting system after 2 hours, but only after 24 hours. Then started digging.

    So the problem is WDT is not getting disabled with sd_nvic_systemreset. That is why I tried with sd_power_system_off and then reset. This time it was able to change the preload value. Only a WDT reset or a POR can only disable the WDT and thereby reconfigure the WDT, if my understanding and experimentation is correct.

    Even we didn't like the workaround as we don't know what other things can break because of this. Can you try it on your side and check if it is working without this workaround. 


Related