Skip to main content
vshah
Associate II
April 22, 2020
Question

IWDG is not turnoff in shutdown mode of controller(STM32L4R5)

  • April 22, 2020
  • 4 replies
  • 1645 views

..

This topic has been closed for replies.

4 replies

Ozone
Principal
April 22, 2020

Exactly.

The watchdogs cannot be turned off once enabled. See the reference manual/datasheets.

vshah
vshahAuthor
Associate II
April 23, 2020

Actually when entering the shutdown/standby mode of controller, as per reference manual/datasheet. IWDG has to be disable, as LSI clock is also getting disabled, but here in my case it is still active and after IWDG configuration time it is resetting the controller. I suspect that bits in the flash optr register need to take care to avoid this issue.

Tomas SIRUCEK
Visitor II
April 24, 2020

Hi,

this is quite tricky. It is true, that IWDG cannot be turned off once enabled. But it is also true, that IWDG and LSI are not running in SHUTDOWN mode (but it can run in STANDBY mode (RefManual)). It is possible, that You are not entering SHUTDOWN mode, but another LP mode.

Please check out also this thread with possibly same issue:

https://community.st.com/s/question/0D50X0000BeaMHpSQM/stm32l4-iwdg-wake-up-device-in-shutdown-mode-

Have a nice day.

vshah
vshahAuthor
Associate II
April 27, 2020

Hi Tomas, Thanks for link, But i feel that problem is with FLASH_OPTR register. Actually this register holding two bit(s) , which can freeze the IWDG in standby and stop mode, but this bit unable to reset. following code i have used.

   HAL_FLASH_Unlock();

   __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR);

   HAL_FLASH_OB_Unlock();

   HAL_FLASHEx_OBGetConfig(&pOBInit);

   pOBInit.OptionType=OPTIONBYTE_USER;

   pOBInit.USERType=OB_USER_IWDG_SW|OB_USER_IWDG_STOP|OB_USER_IWDG_STDBY;

   pOBInit.USERConfig=OB_IWDG_STOP_FREEZE|OB_IWDG_STDBY_FREEZE;

   HAL_FLASHEx_OBProgram(&pOBInit);

   HAL_FLASH_OB_Launch();

   HAL_FLASH_OB_Lock();

   HAL_FLASH_Lock();

Thanks!!!

Piranha
Principal III
July 12, 2020