2018-08-14 07:35 PM
I want to enter the CPU in stop mode and wakeup the CPU using RTC wakeup.
I wrote the following code.
----
(void)HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 2-1, RTC_CR_WUCKSEL_2);
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);
/* STOP MODE */
/* wakeup */
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
----
Question
I expect RTC_IRQHandler to be called.
But RTC_IRQHandler will not call.
why.
void RTC_IRQHandler(void)
{
/* USER CODE BEGIN RTC_IRQn 0 */
UserRTC_Int();
/* USER CODE END RTC_IRQn 0 */
HAL_RTCEx_WakeUpTimerIRQHandler(&hrtc);
/* USER CODE BEGIN RTC_IRQn 1 */
/* USER CODE END RTC_IRQn 1 */
}
2018-08-14 11:08 PM
do you know if the RTC is running ?
did you use the cube ?
is this all of your code ?
If you put a breakpoint at this line , it never gets there ?
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
2018-08-15 06:26 PM
thank you!!
Yes. I used a cube.
I solved this problem.
HAL_RTC_MspInit() was not executed, no interrupt occurred.
It did not call in MX_RTC_Init().
I deleted "if(HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR0) != 0x32F2){"