In this article we will see how to configure the RTC peripheral of the STM32 to wake up the STM32 periodically from a low power mode like STOP2 mode which is one of the lowest power modes of the STM3L4.
For the simplest example of a "once per second" alarm, the article presents the worst approach with an unreliable implementation - the code reconfigures the alarm every second and, if this code is interrupted for more than a second, then the alarm stops working at all.
Similarly for UART those articles doesn't show an actually real life usable reception example, because with the flawed-by-design HAL it is almost impossible.
And, of course, the all of the code examples in knowledge base articles are similarly full of bugs, issues and generally dumb code. Here is an example:
if you just want to get interrupt every each second by RTC. you can use Alarm mode and enable all mask in alarm setting but this function require a calendar.
but if you want it wakeup that you have to make sure it's in sleep mode.