cancel
Showing results for 
Search instead for 
Did you mean: 

LowPower STOP MODE - works only at first init

asafbit
Associate II
Posted on October 31, 2016 at 09:36

hi all

currently on discovery board - trying to put system into stop mode every 5 sec and wake it after 5 sec.

it seems like some flag isn't getting reset or an interrupt issued always (timer interrupt)

how can i track the bug?
2 REPLIES 2
Nesrine M_O
Lead II
Posted on October 31, 2016 at 10:33

Hi Assaf,

1- What are you using as STM32 product?

2-Have you try to start from existent project on CUBE or SPL libraries?

3-As example if you are using STM32F4:

•Standard peripheral  library: STM32F4xx_DSP_StdPeriph_Lib_V1.7.1\Project\STM32F4xx_StdPeriph_Examples\PWR\PWR_STOP

•STM32CubeF4 package:STM32Cube_FW_F4_V1.13.0\Projects\STM32F429I-Discovery\Examples\PWR 

-Syrine-

Walid FTITI_O
Senior II
Posted on October 31, 2016 at 10:52

Hi Assaf ,

It is the continuity of your other [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/RTC%20Wakeup%20from%20Stop%20state%20on%20system%20running%20tim%20interrupt&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=30]thread. So, it seems that one of the wakeup source pending bit is still set which prevent the device to re-enter the stop mode. Ensure to clear the pending bits of wakeup sources (RTC, WU pin) by calling the right function in the IRQ handlers like the following :

/* This function handles RTC Auto wake-up interrupt request. */
void RTC_WKUP_IRQHandler(void)
{
HAL_RTCEx_WakeUpTimerIRQHandler(&RTCHandle);
}
/* This function handles External lines 15 to 10 interrupt request. */
void EXTI15_10_IRQHandler(void)
{
HAL_GPIO_EXTI_IRQHandler(KEY_BUTTON_PIN);
}

Hope that this resolve your issue -Hannibal-