nrf52840: Software reset, doesn't disable the watchdog

We try to test our bootloader (using nRF52840 DK for this).
The firmware that we use to test the bootloader includes an implementation of Watchdog, it works, based on the example: "\v2.5.0\zephyr\samples\drivers\watchdog".

On the bootloader side, we analyze the reasons for the reboot using the "hwinfo_get_reset_cause" function.

During testing we found the following behavior:
1) Reboot due to "PIN reset", "Hardware reset", "Watchdog reset" work correctly. The bootloader is rebooted once, the reason for the reboot is correct;

2) If we use Software reset (for example, using the function: "sys_reboot(SYS_REBOOT_COLD)"), then the bootloader is rebooted twice:
- first time due to Software reset;
- second time reason Watchdog.

How can we prevent repeated reboots during Software reset if Watchdog is activated in the firmware?

Is it possible to disable Watchdog from the bootloader firmware? If yes, then how to do it correctly?

  • Hi,

    2) If we use Software reset (for example, using the function: "sys_reboot(SYS_REBOOT_COLD)"), then the bootloader is rebooted twice:
    - first time due to Software reset;
    - second time reason Watchdog.

    A software reset (NVIC_SystemReset or sys_reboot()) will not reset the watchdog. Only a power on reset or letting the watchdog time out will reset it.

     

    What you can do is to make mcuboot "watchdog aware" by setting this in the child_image/mcuboot.conf (or your equivilant mcuboot configuration):

    CONFIG_BOOT_WATCHDOG_FEED=y

     

    Could you try this and see if this helps?

     

    Kind regards,

    Håkon

Related