STM32 gotchas
294. Backup registers in TAMP can't be read or written, unless APB clock is enabled for RTCv3

In most older STM32 with RTCv2, there are several 32-bit backup registers implemented as part of the RTC module. They are primarily intended to hold sensitive key material, and as such, their content is retained in VBAT mode, they are automatically erased upon Tamper event, and are protected/erased by the RDP mechanism. (Of course, they can be used to hold any other data one desires to be battery-non-volatile).

In newer STM32 with RTCv3, the RTC module has been split to two modules with separate chapters in RM: RTC and TAMP. The backup registers were moved to the TAMP module. However, they still are intimately intertwined, as they both are in the VBAT- (Backup-Power-) domain and there are signals interconnecting them directly. For example, timing (e.g. filtering) of tamper events are governed by the RTCCLK clock as selected in RCC_BDCR for RTC, and when tamper is activated, it triggers timestamping in RTC.

It may appear, that the backup registers themselves are not impacted by these relationships. However, the TAMP module shares the APB interface enable bit with RTC. This is not documented in the RMs, so it may come as a surprise, that to be able to access TAMP_BKPxR registers, RCC_APBENRx.RTCAPBEN has to be set, too.

See also g295.