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?