{
  "id": "embedded/rtc-tamper-battery-backed",
  "signature": "RTC: Tamper event detected on TAMP2, backup registers cleared, system must reinitialize",
  "signature_zh": "RTC：在TAMP2上检测到篡改事件，备份寄存器已清除，系统必须重新初始化",
  "regex": "RTC.*Tamper event detected on TAMP[0-9].*backup registers cleared.*system must reinitialize",
  "domain": "embedded",
  "category": "system_error",
  "subcategory": null,
  "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "RTC TAMP2引脚上的篡改检测事件触发了自动清除备份寄存器（BKP）以保护敏感数据，需要完全重新初始化系统。",
  "versions": [
    {
      "version": "STM32L4 series",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "STM32CubeMX v6.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "HAL_RTC v2.3.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Disable the tamper detection feature entirely",
      "why_fails": "Removes security protection; may be unacceptable for applications requiring anti-tamper (e.g., metering, secure boot).",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Short-circuit TAMP2 pin to ground to prevent false triggers",
      "why_fails": "Damages the pin or causes short circuit; does not address the root cause of noise or mechanical tamper.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Reinitialize backup registers without checking tamper flag",
      "why_fails": "Overwrites valid data and masks the tamper event, potentially allowing unauthorized access to persist.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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.",
      "success_rate": 0.85,
      "how": "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.",
      "condition": "",
      "sources": []
    },
    {
      "action": "After tamper detection, restore backup registers from a secure non-volatile store (e.g., external EEPROM or flash) if the tamper was false.",
      "success_rate": 0.75,
      "how": "After tamper detection, restore backup registers from a secure non-volatile store (e.g., external EEPROM or flash) if the tamper was false.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "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."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.st.com/resource/en/application_note/an4650-rtc-tamper-and-timestamp-features-in-stm32-microcontrollers-stmicroelectronics.pdf",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2025-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}