drivers: hwinfo: stm32: Deal with iwdgX and wwdgX instances
On some STM32 series (H7, MP1), iwdg and wwdg have multiple instances.
Due to current driver implementation, these wdg instances were not
checked in the function.
Fixes
@@ -51,11 +51,31 @@ int z_impl_hwinfo_get_reset_cause(uint32_t *cause)
flags |= RESET_WATCHDOG;
}
#endif
+#if defined(RCC_RSR_IWDG1RSTF)
+ if (LL_RCC_IsActiveFlag_IWDG1RST()) {
+ flags |= RESET_WATCHDOG;
+ }
+#endif
+#if defined(RCC_RSR_IWDG2RSTF)
+ if (LL_RCC_IsActiveFlag_IWDG2RST()) {
+ flags |= RESET_WATCHDOG;
+ }
+#endif
#if defined(RCC_FLAG_WWDGRST)
if (LL_RCC_IsActiveFlag_WWDGRST()) {
flags |= RESET_WATCHDOG;
}
#endif
+#if defined(RCC_RSR_WWDG1RSTF)
+ if (LL_RCC_IsActiveFlag_WWDG1RST()) {
+ flags |= RESET_WATCHDOG;
+ }
+#endif
+#if defined(RCC_RSR_WWDG2RSTF)
+ if (LL_RCC_IsActiveFlag_WWDG2RST()) {
+ flags |= RESET_WATCHDOG;
+ }
+#endif
#if defined(RCC_FLAG_FWRST)
if (LL_RCC_IsActiveFlag_FWRST()) {
flags |= RESET_SECURITY;
