Closed Scarittagle closed 2 months ago
Hi @Scarittagle - are you using STOP modes when you observe this issue with IWDG? You must avoid STOP mode while the IWDG is updating any of its registers using its synchronization mechanism. When all of its updating is finished, it runs properly even in STOP mode. In my applications I have defined ulpPERIPHERAL_IWDG_UPDATING
to help manage this issue.
I am using LSI and IWDG combined without issues on the STM32WBx5 and The STM32U5. So it is no general compatibility issue. Like @jefftenney mentioned you should make sure that the watchdog init is not interrupted by a stop. But I have not seen or read about any issues during the retrigger. Actually I think it is good practise to have the watchdog initialized before the scheduler is even started. Which would also solve the problem above.
MCU: STM32G031G8U6
Core Speed: 2MHz (HSI 8 Div)
Behavior: Because my application don't have external crystals so I used LSI for the LPTIM. It works fine in the tickless idle. But when it comes to IWDG, the
HAL_IWDG_Init(&hiwdg)
always failed.I traced the code to somewhere around here:
It seems like it would always return timeout if I don't put a breakpoint in there. Not sure if it related to this but IWDG uses LSI too.
If I removed LPTIM-Tick and go back to the usual Tickless idle, the IWDG works fine.