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 #53002

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2022-12-15 17:24:37 +01:00 committed by Fabio Baltieri
commit 50473ec0a9

View file

@ -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;