2024-12-29 12:24 AM
Hello,
Now I'm testing 50msec regular Stop and wakeup using
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 102, RTC_WAKEUPCLOCK_RTCCLK_DIV16);
Firstly I expected HAL_RTCEx_WakeUpTimerEventCallback() is done every 50msec but in real it was far faster than expexted.
How do I calculate time interval of HAL_RTCEx_WakeUpTimerEventCallback()?
And I had onother question.
I checked if systick works normally under the regular Stop and wakeup condition.
So I used serial debug by CDC like following but didn't work.
If WakeUpTimer is applied systick doesn't work normally?
Thanks,
static uint32_t count = 0;
count += 1;
uint8_t send_message[30];
sprintf((char *)send_message, "sec:%d\n", (unsigned int)count);
DebugPrint((char *)send_message);
2024-12-30 02:21 AM
Hello @curiae
You can use a GPIO PIN which should be set just before entering stop mode and reset in wakeup callback function. The time interval can be after calculated using oscilloscope.
2024-12-30 02:31 AM
Hello @curiae,
The formula to calculate the wake-up timer interval is:
given:
So, yeah it should be around 50 milliseconds trigger, what's the clock source being used?
Regarding the Systick behavior, -if I understood correctly- it is important to note that when the MCU enters Stop mode, the SysTick timer is stopped. This is because the SysTick is typically driven by the system clock, which is halted in Stop mode to save power.
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.