2026-01-14 3:58 PM
Hello,
I am trying to figure out how to configure internal voltage monitoring use the internal tamper detection to clear the RTC when an undervoltage condition occurs. My understanding is that you have to enable the backup regulator and enable monitoring like this.
SET_BIT (PWR->CR1, PWR_CR1_DBP);
HAL_PWREx_EnableBkUpReg();
HAL_PWREx_EnableMonitoring();But how do I set up the tamper detection. There appears to be an inconsistency between the RM and the SFR view of the RTC registers in CubeIDE. The register at offset 0x40 in the RM is called RTC_TAFCR (pg. 1980) while in CubeIDE it is called RTC_TAMPCR and they have differnt bit definitions. Which of these is correct (thye can't both be)? I believe the internal detection is included in Tamper 3, but how do I configure that.
Without working tamper detection the data is preserved in the RTC at least down to 0.4V but it stops getting updated at a much higher voltage, resulting in losing time when the device is powered on again, but no way to detect that this has happened.