STM32 gotchas
76.RTC digital calibration does not apply to wakeup period (with a specific wakeup source selection)

RTC in STM32 can compensate for inaccuracy of the used crystal by so called digital calibration. This is achieved by a unit, which counts pulses in parallel with the main RTC counter, and when a set number of pulses is counted, it removes (gates) a clock pulse or inserts an extra clock pulse to the main counter, while resetting itself.

The exact working of this unit, and where it is placed within the clock chain of RTC, varies from family to family; at one point (in some 'L1 and in 'F4/'F3) there even were two such units ("coarse" and "fine") present simultaneously.

RTC has also a Wakeup unit, which allows periodic interrupt intended (as its name suggests) to wake up the mcu put into some of the low-power modes (sleep). This is basically a configurable auto-reloading counter, which also has a configurable clock source, selecting and prescaling clocks coming from various points of the RTC clock-chain.

Some of the wakeup unit clock sources are tapped from before the calibration unit. If such clock source is used, wakeup is then "not precise", as it does not include the corrections from the calibration unit.

This issue was brought up here.