2020-07-09 10:08 PM
In my project there is requirement to initialize the IWDG for two times one with time period 5 second in run-mode and re-configuring it for 32 second before controller enters into sleep mode. as shown in below code.
hiwdg.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_64;
hiwdg.Init.Window = 4095;
hiwdg.Init.Reload = 2560;
if (HAL_IWDG_Init(&hiwdg) != HAL_OK) {
Error_Handler();
}
{
//Blocks Of statements
}
hiwdg.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_256;
hiwdg.Init.Window = 4095;
hiwdg.Init.Reload = 4095;
if (HAL_IWDG_Init(&hiwdg) != HAL_OK) {
Error_Handler();
}
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON,PWR_SLEEPENTRY_WFI);
But getting issues in second initialization. second initialization is getting failed.
Using STM32l4r5 controller.
someone please help me out in this issue. thanking in advance.
2020-07-10 02:35 AM
What exactly means "second initialization is getting failed", what are the symptoms?
JW
2020-07-10 04:49 AM
That code runs fine for me on an H7 chip. Don't have an L4 to try.