cancel
Showing results for 
Search instead for 
Did you mean: 

Not waking up from stop3 mode immediately after Programming STM32 controller

mohan-ltts
Associate II

I am working with STM32 U575/U5A5 series of STM32 controllers in low power mode. I have programmed the controller to enter into Stop 3 mode and wake from stop3 mode based on wakeup Pin(High on PF2). With this implementation issue what we observed is once immediately flashing hex file into controller using STlink programmer, Controller is entering in stop3 mode but it is not waking up from stop3 mode even after low to high transistion on wakeUp pin(PF2). If I remove the power and connect it back, it is working as expected enterning into stop mode 3 and waking up from stop mode 3 on low to high transistion on wakeUp pin(PF2) all the time. 

The question here is why for the first time after flashing hex file into controller, entering into stop3 mode but not waking up from stop3 mode and requires power reset?

low power mode is configured as follows:

void LowPowerInit()
{    
    LL_RCC_SetClkAfterWakeFromStop(RCC_STOP_WAKEUPCLOCK_SELECTED);
    __HAL_RCC_PWR_CLK_ENABLE();    
    HAL_PWREx_EnableUltraLowPowerMode();
 
    //Selecting USB select pin(PF2) as wakeup source.
    HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN8_HIGH_0);
 
    NVIC_ClearPendingIRQ(EXTI2_IRQn);
    HAL_NVIC_SetPriority(EXTI2_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(EXTI2_IRQn);
 
    EnterStop3Mode();
}
 
void EnterStop3Mode()
{     
    HAL_PWREx_EnterSTOP3Mode(PWR_STOPENTRY_WFI);    
    SystemClockConfig();
 
    LL_LPM_DisableSleepOnExit();
    LL_PWR_ClearFlag_WU();
    LL_PWR_ClearFlag_STOP();
    LL_PWR_ClearFlag_SB();
    irq_unlock(0);
}
20 REPLIES 20
Sarra.S
ST Employee

Hello everyone, 

I’ve moved the last comment of @mohan-ltts which wasn’t directly related to the initial post (Separate thread link: Issue to wake up from stop 3 mode when migrating fr... - STMicroelectronics Community

However, to conclude this discussion, the issue is resolved when suspending SysTick before entering stop 3 mode.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.