Well I first called HAL_RTC_GetTime(&hrtc, &sTime, RTC_FORMAT_BIN) and falsely assumed that it will initialise the sTime structure completely which is not the case. My bad.If "adult programming" means not taking advantage of existing libraries and al...
Had the same problem and it turned out that the structure sTime that I called like this:HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BIN);had non-initialised members "StoreOperation" and "DayLightSaving" that corrupted the RTC CR in HAL_RTC_SetTime(): ...