cancel
Showing results for 
Search instead for 
Did you mean: 

What to configure after stopmode wakeup?

JC Lebreton
Associate II
Posted on May 16, 2018 at 12:58

Hi fellows, 

I have a issue when i exit the stopmode on my stm32h7.

I notice that my power consumption goes down from 34mA to 5mA when i put my MCU in StopMode. But after the wake up from the StopMode i read 19mA. 

This issue leads me to the fact that i don't configure my clock on the right way after a WakeUp from the StopMode.

Does someone had the same issue or does someone have a clue for me?

Thanks in advance

JC 

Note : I already try different exemple code and none worked...

4 REPLIES 4
Artur IWANICKI
ST Employee
Posted on May 17, 2018 at 08:22

Hello,

During enter into STOP mode all clocks are stopped (RTC clocks LSE can be still operational but it is kept in backup domain and this clock cannot drive the core).

After wakeup from STOP mode MCU is woken up using one of the internal clocks (in H7 it is HSI 16MHz) as it is starting in shortest time. Then it is up to the user to reconfigure the clock system to desired frequency (starting HSE, configuration PLL), but it takes time.

Concerning power consumption in STOP mode. Please remember that there is no action done on GPIO lines those will keep the state like before the entrance into low power mode.

I have found one example with entrance and exit from STOP mode with clock reconfiguration. It has been prepared for STM32H743ZI-Nucleo, but can be ported to any other STM32H7.

You can find it within

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-mcu-packages/stm32cubeh7.html

in the path:

.\STM32Cube_FW_H7_V1.2.0\Projects\STM32H743ZI-Nucleo\Examples\PWR\PWR_STOP_RTC\

I hope it helps.

Best Regards,

Artur

Posted on May 17, 2018 at 10:54

Hi,

Thanks for the answer.

In fact i'm already using the HSI as main clock instead of the HSE. Is this a good or not i don't know. I just need the full potential of the H7 at some point.

The stange thing is that if i call 'SystemClock_Config' after exiting StopMode I get back to a normal working environement. But i can't go to stop mode again (while loop) and can't even go in StandByMode... 

Could it be a flag issue?

I know i do something wrong but what is the question ...
Artur IWANICKI
ST Employee
Posted on May 21, 2018 at 06:58

Hello,

Most probable reason that you cannot go into STOP  mode is that either some wakeup flag is not cleared or wakeup signal is still active. With STANDBY mode it could be active wakeup source which causes immediate wakeup as we are coming back from STANDBY always via RESET and executing the code from the begining afterwards (but please be careful as BACKUP domain (with RTC) is not affected by any reset except POR/BOR one).

Could you please pass me part of your code with the code executed just after wakeup, please? 

Hi.

If you call 'SystemClock_Config' the Tick gets enabled and it will be preventing STM from going into stop mode again.

You can call 'HAL_SuspendTick();' after clock config.