2017-03-21 03:41 PM
I require a periodic wakeup from shutdown-mode. For that I found two recipes: AN4759 (table 7) and RM0351 (section 3.7). Essentially they provide the same info. Unfortunately it did not work until I tripped over “When the periodic wakeup interrupt is enabled by setting the WUTIE bit in the RTC_CR2 register, it can exit the device from low-power modes.�? (RM0351, section 3.6)
I added “
LL_RTC_EnableIT_WUT (RTC);
�? and it worked as expected.
I was puzzled because the NVIC is powered off in shutdown mode. So there are no interrupts.
Isn’t there something missing in the recipes? Is WUTIE really required?
2017-09-22 09:00 AM
Old thread, but...
Yes, WUTIE is needed. It lets the RTC to generate interrupt requests. I low power mode NVIC is, indeed, 'OFF', but it's 'replaced' by a low power interrupt controller that can wake the system up. That was metioned somewhere in the documentation, but I can't find it right away.
The WUTIE controls whether or not there is a 'timer underrun signal' from the WUT at all.
2017-09-22 12:39 PM
First of all, thank you for reading and answering and confirming my assumption.
The STM32L4 is a really powerful and complex beast which can only be tamed by a diligent documentation. But far too often the docs are ambiguous (e.g., like you mentioned in “RM0351 RTC Wakeup�). And far too often STM does not fix the issues. The current revision (5) of RM0351 still writes about the non-existent “RTC_CR2� register and still has not fixed the recipe for enabling cyclic wakeups (RTC_WUTIE still missing). So does AN4759. As you said: Old thread �? I say: nothing happened. ☹
Other parts of the RM0351 (table 213) suggest that there is such a thing as a “low power interrupt controller� which monitors RTC_WUTIE.
2017-09-22 01:22 PM
I think STM is not very enthusiatic for supporting bare metal low level programmers. They push their HAL.
2017-09-22 01:40 PM
I don't think ST cares what you do, plenty of people do register level coding but it requires reading and interpreting documentation, and connecting the dots where necessary.
The amount of documentation explodes with each new part or variant released, got to be a royal pain...
2017-09-22 06:29 PM
“Pushing their HAL�, they have to do lots of low level programming covering all peripherals in all states of the MCU. That way, they should really put their feet in it. Meaning, they find all inconsistencies between documentation and implementation (euphemistic for errors). Doing their job professionally, they must give a feedback to the maintainers of the docs. I.e., “pushing their HAL� is no excuse. But, there are so many pages… ☺
2017-09-22 06:35 PM
“… connecting the dots where necessary.�? Exactly. I couldn’t have said it better. ☺!
2017-09-27 09:14 AM
Hello,
Thank you for bringing the typo errors to our attention.
I will report your feedback and errors to the appropriate team.
Kind Regards
Imen