2016-12-13 12:52 AM
I am trying to put the STM32L471RG into Shutdown mode.
I am doing the following steps, based on the documentation.
// Turn on Deepsleep bit
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk; // Setup Low Power Mode State and Shutdown PWR->CR1 |= 0x4004; // Set LPR and LPMS_SHUTDOWN bits // Clear WUFx bits PWR->SR1 &= ~PWR_SR1_WUF; // Go to sleep __WFE();I believe this should put the MCU in shutdown mode. I have a watchdog running also. In the shutdown mode the watchdog should get turned off, and it should not be able to reset it. But the MCU is getting reset. I checked by turning on the freeze watchdog counter option bit for STOP mode, this did stop the reset from happening. This would imply the MCU has actually gone into one of the two STOP modes.
What am I doing wrong?
#low-power #stm32l4 #shutdown2017-04-07 06:50 AM
I have exactly the same problem with the STM32L432! No answers yet???
2017-04-11 06:11 AM
Hi Mike Oliva,
Have a look to the
PWR_SHUTDOWN
example within the STM32CubeL4 firmware package:
STM32Cube_FW_L4_V1.7.0\Projects\STM32L496ZG-Nucleo\Examples\PWR\PWR_SHUTDOWN
Hope this help you.
Imen
2017-04-12 12:26 PM
Thank you Imen, but that example does not have a watchdog timer running as the original poster (Anand) and I both have. It appears that in both of our cases, the watchdog clock is still running in shutdown mode and the watchdog causes a reset which brings us out of shutdown mode, which was not what we expected. I also had LPTIM1 running. I have now disabled LPTIM1 before going into shutdown and this may have solved my problem, but I don't understand why. I am still testing.
Mike
2018-05-14 12:26 AM
I am experiencing the same issue: the MCU (STM32L433) is put into shutdown mode but the IWDG kicks in when down-counter reaches zero. It is supposed to be powered-down according to the documentation. I don't have any LPTIM active. Could not see errata about this behaviour.
So, is it a know bug or not ? What is the proper way to use IWDG and shut-down mode together ?
IWDG is supposed to protect against malfunctions, not to cause them...