2018-12-10 02:25 AM
I have some code like below
while (1)
{
HAL_GPIO_WritePin(LED_1_GPIO_Port, LED_1_Pin, GPIO_PIN_SET);
HAL_Delay(1000);
HAL_GPIO_WritePin(LED_1_GPIO_Port, LED_1_Pin, GPIO_PIN_RESET);
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 5, RTC_WAKEUPCLOCK_CK_SPRE_16BITS) != HAL_OK)
{
Error_Handler();
}
__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
}
}
also I enable EXIT3 , i want to the detailed process if i trigger the EXIT3
if mcu in stop mode i trigger the EXIT3 does it need to reset the rtc timer in IRQ handler?
2018-12-17 07:26 AM
Hello,
Which STM32 MCU are you using?
Regards,
Mohamed Aymen.
2018-12-19 06:19 PM
STM32L0K8
2018-12-19 07:59 PM
These would probably be a good examples
STM32Cube_FW_L0_V1.10.0\Projects\STM32L011K4-Nucleo\Examples\PWR\PWR_STOP_RTC
STM32Cube_FW_L0_V1.10.0\Projects\STM32L011K4-Nucleo\Examples\PWR\PWR_STOP
basically a hybrid thereof.
My expectation is that either interrupt source would wake, and you should deactivate the RTC wakeup in the EXTI callback if it wakes via the EXTI event.