cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4r5vit rtc alarm to wakeup from stopmode2

AJ.2
Associate II

how to implement STM32L4r5vit rtc alarm to wakeup from stopmode2

4 REPLIES 4
STTwo-32
ST Employee

Hello @AJ.2 

I suggest you to take a look at the following example to understand how to wake-up from stop2 using an RTC wakeup timer.

Best Regards.

STTwo-32 

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.

can we wakeup from stop mode from RTC internal alarm

 

According to the RM0432,  the RTC alarm,RTC tamper event, RTC timestamp event, and RTC Wakeup cause the device to exit the Stop mode.

Screenshot_2024-01-20-15-04-11-97_e2d5b3f32b79de1d45acd1fad96fbb0f.jpg

Best Regards.

STTwo-32 

 

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.

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();