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);
}
13 REPLIES 13

Hello @mohan-ltts 

Did you try with the latest version (2.18.0) of STM32Cube programmer please.

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

Hello @Saket_Om 

Thanks for your reply. I didn't try with version 2.18.0. I will try and let you know the feedback.

Can you please also tell me when this issue is possible? Like some bit is set/cleared before entering into Stop3 mode this is possible like that if you share some information i will debug and share you the update.

Thanks,

Mohan

any updates on this ticket?

ASEHST
ST Employee

Hello @mohan-ltts,

Using this ST example STM32CubeU5/Projects/NUCLEO-U575ZI-Q/Examples/PWR/PWR_LPMODE_RTC at main · STMicroelectronics/STM32CubeU5 with your configuration does not cause the issue you mentioned. It works fine without the need for a reset.

As mentioned by @Imen.D, please redefine the PWR_S3WU_IRQHandler to wake up the system as shown below.

image (3).png

This scenario was tested with IAR, STM32Cube programmer v1.17.0 and STM32Cube programmer v1.18.0.

Please try to use the newer versions as they are more up-to-date and can help avoid any potential issues.

 

With Regards,

If your question is answered, please close this topic by clicking "Accept as Solution".