2021-07-01 08:32 PM
Hi, I'm using STM32L431xx series mcus and I want to perform a read on the RTC time.
Normally I would do that with a simple read operation on registers, specifically, the RTC_TR and RTC_DR register, but I am afraid that's not how things were supposed to be done.
So my questionS are:
Thanks in advance.
2021-07-02 12:13 AM
> I am afraid that's not how things were supposed to be done.
That's how things are supposed to be done. Reading those registers, in that order. Read the RTC chapter in RM and the Errata to your chip.
JW
2021-07-02 10:09 AM
You can use HAL_RTC_GetTime/HAL_RTC_GetDate.
They just read the registers, though, plus some conversion into a potentially "user-friendly" data structure.