Description
Is your enhancement proposal related to a problem? Please describe.
The watchdog driver for the NRFX drivers (source code) cannot be started automatically on boot. This poses an issue where the watchdog can only be started later in the application code and does not offer protection if anything in sys init gets stuck. Additionally, this watchdog can't be used in something like MCUboot if without modifying the its source code.
Describe the solution you'd like
A way to enable and install the watchdog timeout using only Kconfig options.
The Kconfig options should allow the equivalent of calling wdt_install_timeout
and wdt_setup
. It seems reasonable to perform this initialization within the devicetree init function of the watchdog itself.
Describe alternatives you've considered
There have been several related issues raised:
#57188
mcu-tools/mcuboot#1688
Using CONFIG_WDT_DISABLE_AT_BOOT=n
has been suggested, however it doesn't reflect the intent well here as the watchdog is not enabled by default at boot.
It's also possible to register a callback to sys init in either the EARLY
or one of the PRE_KERNEL
stages. However, an early callback means the watchdog devicetree is not initialized, while the priorities must be set correctly for a PRE_KERNEL
level callback. Most importantly, this approach does not work for MCUboot.
Additional context
The Nordic SoCs (NRF52) do not have a non-volatile configuration register that starts the watchdog automatically in hardware, so it must be enabled through boot.