cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to put STM32L471RG into Shutdown mode

Anand Srivastava
Associate
Posted on December 13, 2016 at 09:52

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 #shutdown
4 REPLIES 4
Mike Oliva
Associate II
Posted on April 07, 2017 at 15:50

I have exactly the same problem with the STM32L432!  No answers yet???

Posted on April 11, 2017 at 13:11

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on April 12, 2017 at 19:26

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

Vincent HUE
Associate II
Posted on May 14, 2018 at 09:26

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...