cancel
Showing results for 
Search instead for 
Did you mean: 

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

vshah
Associate II
 
5 REPLIES 5
Ozone
Lead

Exactly.

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

vshah
Associate II

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
Associate II

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.

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
Chief II