Skip to main content
Rghar.1
Visitor II
July 10, 2020
Question

IWDG initialization Error.

  • July 10, 2020
  • 2 replies
  • 1236 views

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.

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
July 10, 2020

What exactly means "second initialization is getting failed", what are the symptoms?

JW

TDK
July 10, 2020

That code runs fine for me on an H7 chip. Don't have an L4 to try.

"If you feel a post has answered your question, please click ""Accept as Solution""."