Associate
December 14, 2022
Question
STM32G070: How to wakeup from STOP1 using RTC? Any example? Does anybody can help me, please?
- December 14, 2022
- 4 replies
- 3513 views
Hi all,
I'm trying to periodically wakeup from STOP1 using RTC, but it is not working...
SystemClock_Decrease();
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF);
/* De-init LED4 */
BSP_LED_DeInit(LED4);
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 5, RTC_WAKEUPCLOCK_CK_SPRE_16BITS);
/* Suspend Tick increment to prevent wakeup by Systick interrupt. */
/* Otherwise the Systick interrupt will wake up the device within 1ms */
/* (HAL time base). */
HAL_SuspendTick();
/* Enter Sleep Mode, wake up is done once User push-button is pressed */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);