2020-11-04 01:24 AM
when I use STM32L051, its iwdg and stop function ,after it enter stop mode ,the iwdg is also working,I want to close the iwdg when it's stopped,but I didn't find this bit of "IWDG_STOP" in FLASH_OPTR register ,so I don't know how to do ,because I use this function with STM8L051.
Solved! Go to Solution.
2020-11-04 06:35 PM
@Imen DAHMEN I got a way to solve this problem, I set the rtc BKP1R register before entering the stop mode ,then it will be reset by iwdg ,before IWDG init,check the value of the rtc BKP1R register,then do not init IWDG and enter stop mode again. It seems work as expected.
Is this way effective or it's not a right way or there will be any other bugs exist I don't know.
2020-11-04 01:35 AM
Is it right to set the soft iwdg , soft iwdg will be closed when it enter stop mode.
2020-11-04 03:48 AM
Hello @泽锋 陶 ,
IWDG cannot be stopped once it has been started, except by reset.
According to the RM0377 reference manual: "Independent watchdog (IWDG): the IWDG is started by writing to its Key register or by hardware option. Once started it cannot be stopped except by a Reset. Refer to Section 20.3: IWDG functional description in Section 20: Independent watchdog (IWDG)."
So, in STOP mode, once the watchdog is enabled, then it can not disabled unless it goes again to reset if enabled by software and not by Hardware.
You just have to make sure that your application resets IWDG as well.
Imen
2020-11-04 05:24 AM
Thanks for your support.
It means I also cannot disable the watchdog if I set the WDG_SW to zero,zero is soft ,yes?
So I should not enable it after the watchdog reset in stop mode, is it right?
2020-11-04 06:35 PM
@Imen DAHMEN I got a way to solve this problem, I set the rtc BKP1R register before entering the stop mode ,then it will be reset by iwdg ,before IWDG init,check the value of the rtc BKP1R register,then do not init IWDG and enter stop mode again. It seems work as expected.
Is this way effective or it's not a right way or there will be any other bugs exist I don't know.