Skip to main content
AJ.2
Associate
January 26, 2024
Question

STM32L4r5vit rtc wakeup from stopmode2 and unable to re enter stopmode2

  • January 26, 2024
  • 1 reply
  • 661 views

Hi i am able to enter stop mode but after returning stop mode again i am unable enter stop mode

HAL_RTCEx_DeactivateWakeUpTimer(&hrtc); 
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x3FFF, RTC_WAKEUPCLOCK_RTCCLK_DIV16);
 
HAL_SuspendTick();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);  
 
if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET){
/* Clear standby flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
}
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF2);
__HAL_PWR_CLEAR_FLAG(PWR_EXTI_LINE_PVD);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUFI); 
 
HAL_ResumeTick();  

1 reply

Technical Moderator
February 2, 2024

Hello @AJ.2 ,

I advise you this FAQ to help you in your configuration: How to configure the RTC to wake up the STM32 peri... - STMicroelectronics Community

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks