cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 IWDG Standby

Gabriel Gagnon
Associate

Hi,

I have been banging my head for a while now and decided to reach out for help. I am trying to get the IWDG to freeze during Standby. Based off the reference manual I have toggled the IWDG_FZ_SDBY bit to 0. In STM32CubeProgrammer it is set to 0 so theoretically it should Stop the IWDG while in Standby. But the board keeps resetting, I decided to test this out on the NUCLEO-H743ZI2, same thing is happening and the code is extremely simple.

HAL_Init();
SystemClock_Config();
 
FLASH_OBProgramInitTypeDef OBInit;
HAL_FLASHEx_OBGetConfig(&OBInit);
if(OBInit.USERConfig & OB_IWDG_STDBY_ACTIVE)
{
	// Unlock flash option bytes
	HAL_FLASH_Unlock();
	HAL_FLASH_OB_Unlock();
 
	OBInit.OptionType = OPTIONBYTE_USER;
	OBInit.USERConfig = OB_IWDG_STDBY_FREEZE;
	OBInit.USERType = OB_USER_IWDG_STDBY;
	HAL_FLASHEx_OBProgram(&OBInit);
 
	HAL_FLASH_OB_Launch();
}
 
  MX_GPIO_Init();
  MX_ETH_Init();
  MX_USART3_UART_Init();
  MX_USB_OTG_FS_PCD_Init();
  MX_IWDG1_Init();
 
  HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, SET);
  int i =0;
 
while (1)
{
	HAL_Delay(300);
	HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
	i++;
 
	if(i>=10)
		HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, RESET);
	if(i>=30)
	{
		__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
		HAL_PWR_EnterSTANDBYMode();
	}
	HAL_IWDG_Refresh(&hiwdg1);
}

I also tried the same thing on the NUCLEO-L432KC and this time it is working. I have looked online to see if people had a similar problem and cannot seem to find anything about this.

Anyone can help?

I will be implementing a quick solution in the meanwhile that includes writing to the flash before going in Standby and reading that flash at boot. I would prefer not use this in the final product though.

Thanks

0 REPLIES 0