Open AustinLiuMesoMat opened 1 month ago
Hi @AustinLiuMesoMat! We appreciate you submitting your first issue for our open-source project. 🌟
Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙
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
andwdt_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: https://github.com/zephyrproject-rtos/zephyr/issues/57188 https://github.com/mcu-tools/mcuboot/issues/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 thePRE_KERNEL
stages. However, an early callback means the watchdog devicetree is not initialized, while the priorities must be set correctly for aPRE_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.