STM32 gotchas
295. Backup registers in TAMP can't be written, unless backup-domain protection is disabled

The TAMP register - found in newer STM32 with RTCv3 - is part of the Backup-Power (VBAT) Domain. As such, the Backup-Power Domain write protection, applies to TAMP, and its registers - including the TAMP_BKPxR Backup registers - too. So, before attempting to write to them - besides enabling the RTC APB clock - this protection has to be removed, too, by setting the PWR_CR1.DBP bit 1.

This fact is documented in the RMs.


1. To be able to write to PWR_CR1, PWR's clock in RCC has to be enabled first.