diff --git a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp index 88c8864a2f..0b60c8ba57 100644 --- a/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp +++ b/libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp @@ -29,7 +29,9 @@ #include "hwdef/common/watchdog.h" #include #include +#ifndef HAL_BOOTLOADER_BUILD #include +#endif #include @@ -201,7 +203,9 @@ static void main_loop() g_callbacks->setup(); -#ifndef IOMCU_FW +#ifdef IOMCU_FW + stm32_watchdog_init(); +#elif !defined(HAL_BOOTLOADER_BUILD) // setup watchdog to reset if main loop stops if (AP_BoardConfig::watchdog_enabled()) { stm32_watchdog_init(); @@ -216,9 +220,8 @@ static void main_loop() pd.internal_errors, pd.internal_error_count); } -#else - stm32_watchdog_init(); #endif + schedulerInstance.watchdog_pat(); hal.scheduler->system_initialized();