STM32 RTC3 Mixed Mode: Writing TR resets SSR

29 Views Asked by At

Some of the new STM32 chips include a binary RTC mode, which, for example, is used for the LoRaWAN stack timing in the examples. The RTC can be run in mixed mode, where both binary part (32-bit down-counting sub-seconds register SSR) and classic BCD calender mode are operational.

This works perfectly fine until I try to set the BCD calender time part with HAL_RTC_SetTime.

It turned out, that as soon as RTC->TR is written, RTC->SSR is reset to 0xFFFFFFFF. As all timers backed by the binary mode rely on SSR, they fail.

I tried backing up SSR and writing back after RTC->TR write, but it seems to be read-only.

Am I missing something? If a mixed mode has been introduced, I doubt normal behaviour is that the BCD part cannot be set anymore without affecting the binary mode part.

1

There are 1 best solutions below

0
Robert L. On