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.
Ok, this seems to be by design. After RTC init mode exits, SSR is reset:
https://community.st.com/t5/stm32-mcus-products/stm32-rtc3-mixed-mode-writing-tr-resets-ssr/m-p/655899/highlight/true#M239486