Watchdog isn't disabled at boot when CONFIG_WDT_DISABLE_AT_BOOT=y

Windows 11, WSL2, NCS 2, VSCode

I want to be able to reboot my chip without the watchdog automatically being enabled on boot.

I cannot seem to disable it through the API (-PERM return value).

This happens when I  sys_reboot(SYS_REBOOT_COLD) or NVIC_SystemReset().

My prj.conf has:

CONFIG_WATCHDOG=y
CONFIG_NRFX_WDT0=y
CONFIG_WDT_DISABLE_AT_BOOT=y
Is there something I'm misunderstanding?
How can I get this to work?
Thanks.
Parents
  • Hi,

    Started watchdog cannot be stopped on nRF devices.

    For more information on the nRF watchdog, see nRF52840: WDT — Watchdog timer.

    Seeing this, I think that the CONFIG_WDT_DISABLE_AT_BOOT should not work for CONFIG_WDT_NRFX, and I have suggested this to our developers.

    Regards,
    Sigurd Hellesvik

  • Hi, not sure what you mean "should not work," since I'm saying it doesn't work.

    I implemented this using the zephyr library, but never got any callbacks on the interrupt callback, not sure why.  I see INTENSET disables interrupts.  Would disabling that prevent the watchdog from firing?

    How can I improve my situation?  Can I change the remaining time on the watchdog to be 0 somehow to cause an instant reboot-via-watchdog?  Something else?

    How does anyone else deal with this problem?

    Thanks.

  • douglas.malnati said:
    Hi, not sure what you mean "should not work," since I'm saying it doesn't work.

    To clarify: If the nrfx drivers do not support disabling WDT, you should get a warning or error when setting CONFIG_WDT_DISABLE_AT_BOOT.

    douglas.malnati said:
    I implemented this using the zephyr library, but never got any callbacks on the interrupt callback, not sure why.  I see INTENSET disables interrupts.  Would disabling that prevent the watchdog from firing?

    No.

    From nRF52840: WDT — Watchdog timer:

    "See Reset for more information about reset sources. If the watchdog is configured to generate an interrupt on the TIMEOUT event, the watchdog reset will be postponed with two 32.768 kHz clock cycles after the TIMEOUT event has been generated. Once the TIMEOUT event has been generated, the impending watchdog reset will always be effectuated. "

    In other words: You get two cycles to react before the reset, but it will still trigger.

    douglas.malnati said:

    How can I improve my situation?  Can I change the remaining time on the watchdog to be 0 somehow to cause an instant reboot-via-watchdog?  Something else?

    How does anyone else deal with this problem?

    I hope that I can give some tips here, but first, I think it would be useful to know the following:

    Why is it a problem that the watchdog is active after a reset?

    Regards,
    Sigurd Hellesvik

Reply
  • douglas.malnati said:
    Hi, not sure what you mean "should not work," since I'm saying it doesn't work.

    To clarify: If the nrfx drivers do not support disabling WDT, you should get a warning or error when setting CONFIG_WDT_DISABLE_AT_BOOT.

    douglas.malnati said:
    I implemented this using the zephyr library, but never got any callbacks on the interrupt callback, not sure why.  I see INTENSET disables interrupts.  Would disabling that prevent the watchdog from firing?

    No.

    From nRF52840: WDT — Watchdog timer:

    "See Reset for more information about reset sources. If the watchdog is configured to generate an interrupt on the TIMEOUT event, the watchdog reset will be postponed with two 32.768 kHz clock cycles after the TIMEOUT event has been generated. Once the TIMEOUT event has been generated, the impending watchdog reset will always be effectuated. "

    In other words: You get two cycles to react before the reset, but it will still trigger.

    douglas.malnati said:

    How can I improve my situation?  Can I change the remaining time on the watchdog to be 0 somehow to cause an instant reboot-via-watchdog?  Something else?

    How does anyone else deal with this problem?

    I hope that I can give some tips here, but first, I think it would be useful to know the following:

    Why is it a problem that the watchdog is active after a reset?

    Regards,
    Sigurd Hellesvik

Children
Related