embedded
system_error
ai_generated
partial
RTC: Tamper event detected on TAMP2, backup registers cleared, system must reinitialize
ID: embedded/rtc-tamper-battery-backed
80%Fix Rate
84%Confidence
1Evidence
2025-01-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| STM32L4 series | active | — | — | — |
| STM32CubeMX v6.9.0 | active | — | — | — |
| HAL_RTC v2.3.0 | active | — | — | — |
Root Cause
A tamper detection event on the RTC TAMP2 pin triggered automatic clearing of backup registers (BKP) to protect sensitive data, requiring full system reinitialization.
generic中文
RTC TAMP2引脚上的篡改检测事件触发了自动清除备份寄存器(BKP)以保护敏感数据,需要完全重新初始化系统。
Official Documentation
https://www.st.com/resource/en/application_note/an4650-rtc-tamper-and-timestamp-features-in-stm32-microcontrollers-stmicroelectronics.pdfWorkarounds
-
85% success Implement a debounce filter on the TAMP2 pin using a low-pass RC circuit (e.g., 10kΩ resistor + 100nF capacitor) to filter out transient glitches.
Implement a debounce filter on the TAMP2 pin using a low-pass RC circuit (e.g., 10kΩ resistor + 100nF capacitor) to filter out transient glitches.
-
75% success After tamper detection, restore backup registers from a secure non-volatile store (e.g., external EEPROM or flash) if the tamper was false.
After tamper detection, restore backup registers from a secure non-volatile store (e.g., external EEPROM or flash) if the tamper was false.
中文步骤
Implement a debounce filter on the TAMP2 pin using a low-pass RC circuit (e.g., 10kΩ resistor + 100nF capacitor) to filter out transient glitches.
After tamper detection, restore backup registers from a secure non-volatile store (e.g., external EEPROM or flash) if the tamper was false.
Dead Ends
Common approaches that don't work:
-
Disable the tamper detection feature entirely
70% fail
Removes security protection; may be unacceptable for applications requiring anti-tamper (e.g., metering, secure boot).
-
Short-circuit TAMP2 pin to ground to prevent false triggers
90% fail
Damages the pin or causes short circuit; does not address the root cause of noise or mechanical tamper.
-
Reinitialize backup registers without checking tamper flag
80% fail
Overwrites valid data and masks the tamper event, potentially allowing unauthorized access to persist.