Backup registers
The 32-bit backup registers (RTC_BKPxR) are reset when a tamper detection event occurs. These registers are powered-on by VBAT when VDD is switched off (some products do not implement this feature, like STM32L0 series and STM32L1 series. Refer to Table 4 Advanced features for RTC2 type and AN4759_Adv-RTC-features.html#id_33173__table_hqc_shf_rpb. They are not reset by a system reset, and their contents remain valid when the device operates in low-power mode.
For RTC2 type on STM32L0, STM32L4, and STM32F7 series, the 32-bit backup registers (RTC_BKPxR) are not reset if TAMPxNOERASE = 1 or if TAMPxMF = 1 in RTC_TAMPCR.
For RTC3 type, the 32-bit backup registers (TAMP_BKPxR) are not reset if TAMPxNOER = 1 or if TAMPxMSK = 1 in TAMP_CR3.
The VBAT availability, the LPTIM availability and the number of backup registers depend on the product. Refer to Table 4 Advanced features for RTC2 type and AN4759_Adv-RTC-features.html#id_33173__table_hqc_shf_rpb.
The RTC3 backup registers can be protected against nonsecure or unprivileged accesses (see Reduce power consumption).
- Zone 1: read and write secure
- Zone 2: read nonsecure and write secure
- Zone 3: read and write nonsecure
Secure AES boot hardware key (RTC3 only)
This section is valid only for products embedding a SAES.
The backup registers can be used to store the BHK (boot hardware key) of the SAES (secure AES). If the device supports Arm® TrustZone® security, the eight first backup registers (TAMP_BKP0R to TAMP_BKP7R) must be configured as belonging to the zone 1 (r/w secure) by setting BKPRWSEC ≥ 8 in TAMP_SECCFGR.
Once the registers are written with the key, BHKLOCK must be set to 1 in TAMP_SECCFGR to definitively block the read/write accesses to these registers (any reading returns 0 and any writing is ignored). BHKLOCK can only be cleared by hardware after a tamper event or when readout protection is disabled. In these two case, the backup registers are also erased. After BHKLOCK is set, the SAES coprocessor can use the BHK thanks to a private hardware bus (see the SAES section in the product reference manual and more precisely KEYSEL bits in the SAES control register).