Why setting up RTC WKUP interrupt will generate HAL_RTCEx_SetWakeUpTimer_IT in init?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-05 1:07 AM
I want to enable RTC WKUP interrupt, so that I can use it later to wake the device up from sleep modes.
Nevertheless, CubeMX will also add HAL_RTCEx_SetWakeUpTimer_IT in init. I don't want to launch the timer in init! I only want to set it up for later use (setup interrupt handlers, NVIC enable).
- Is this call 100% necessary? Why CubeMX generates it in init?
- What does it mean if WakeUpCounter parameter to this call is 0?
- Labels:
-
RTC
-
STM32CubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-05 2:35 AM
Hi @Tuoman​
> Is this call 100% necessary? Why CubeMX generates it in init?
Yes STM32CubeMX calls this function when we activate the WakeUp, then go to the NVIC Settings table and Enable the RTC wake-up interrupt Through EXTI line 19.
When we generate code: we get this function
HAL_RTCEx_SetWakeUpTimer_IT
When we uncheck the RTC wake-up interrupt Through EXTI line 19
Then we go to the generated code: we get this function HAL_RTCEx_SetWakeUpTimer
> What does it mean if WakeUpCounter parameter to this call is 0?
0 is the default value, you can change it :
Best regards,
Nesrine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-05 3:42 AM
Hello, Nesrine. Unfortunately this did not answer my question at all. You answered how to setup WakeUp in CubeMX (I already know) and that I can change value from 0 (I already know)
My questions still remain;
- Why is the HAL_RTCEx_SetWakeUpTimer_IT call necessary? I don't want to start the timer in init, I just want to set it up for later use. Why CubeMX automatically generates it in init? Is this CubeMX bug?
- What does it mean if WakeUpCounter parameter to this call is 0? "0 is the default value" What does it do? Launch timer interrupt immediately? Nothing? Will it break something?
