How to enable the system watchdog and use it inside a out of tree module

Hi,

I posted this on the discord, but thought I might want to try my chance here also. (here’s the discord thread: Discord)

I’m currently using an out of tree module, and I would like to use the watchdog offer by PX4. I’ve spoken with @dagar previously, and he pointed me to the UavcanNode driver. But I’m having a hard time using it inside my module. I’ve include the #include <drivers/drv_watchdog.h> but when I try to use it, I get this error:

undefined reference to `watchdog_init'

I’m using the FMU v6C board. Maybe it’s not implemented for this platform?

image

The reason I’m saying this is because I’m seeing multiple platform that have the implementation, but not the H7 from STM32 that is used inside the v6C. Could that be it?

Anyway, any help to allow me to implement it would be greatly appreciated.

Talking with @dagar he suggested that indeed we were missing the implementation for the H7. So he told me to try to implement it by copying one of the F7. And using the register definition that can be found in the NuttX implementation of the driver (NuttX/arch/arm/src/stm32h7/stm32_iwdg.c at 5d74bc138955e6f010a38e0f87f34e9a9019aecc · PX4/NuttX · GitHub).