2016-11-18 05:45 AM
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 STANDBYHAL_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-stm32l0512016-11-18 06:05 AM
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-2016-11-21 04:12 AM
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.thanksJ.