cancel
Showing results for 
Search instead for 
Did you mean: 

Problem entering Standby mode STM32L051

jaimadafaca
Associate II
Posted on November 18, 2016 at 14:45

Hi all,

I have an odd behavior on my STM32L051 trying to enter in STANDBY mode.  I would be pleased if you could help me. 

My program repeat endless cycles activity and Standby.

Once the firmware boot and after some activity, I program de RTC to wakeup with RTC (alarm A), then I go to STANDBY mode.

It seems to work fine, but after some cycles working well, the system doesn�t enter in Standby mode.  

The extract of my code is:

 

HAL_Init();

SystemClock_Config();

SystemPower_Config();  /* Check and handle if the system was resumed from StandBy mode */

 if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)

   {__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);}/* Clear Standby flag */

Applicacion activity..

Program RTC ..

//GO TO STANDBY

HAL_RTCEx_DeactivateWakeUpTimer(&RTCHandle);

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); /*Clear all related wakeup flags*/

HAL_PWR_EnterSTANDBYMode();/*Enter the Standby mode*/

while (1)

  {Led_GREEN_on();}

Sometimes I see the led green is ON.  How is could be possible if previous instruction is to enter in Standby?

As I told before, it only fails (green ON) in some cases. I don�t know why.

 

Do you know any condition for doesn�t enter in Standby mode after  HAL_PWR_EnterSTANDBYMode instruction?

 

I�m using HAL drivers V1.4.0.

I have downloaded v1.7.0 but on release notes I didn�t see any mention to that. 

Thank you.

Jai

#standby-stm32l051
2 REPLIES 2
Nesrine M_O
Lead II
Posted on November 18, 2016 at 15:05

Hi Jai,

Have you try the ready example under the STM32CUBEL0 package?

STM32Cube_FW_L0_V1.7.0\Projects\STM32L053C8-Discovery\Examples\PWR\PWR_STANDBY_RTC 

-Syrine-

jaimadafaca
Associate II
Posted on November 21, 2016 at 13:12

Hi, 

Yes, tested ok with nucleo board.

In my PCB and my code, I think that I know the problem. 

Previous to go Standby mode, I've desactivated all interrupts (timers, uart) and now seems to work fine.

thanks

J.