{
  "id": "embedded/rtc-calibration-trim-failed",
  "signature": "RTC: calibration trim failed, RTC_ISR_INITF not set within 2 seconds",
  "signature_zh": "RTC：校准调整失败，RTC_ISR_INITF在2秒内未置位",
  "regex": "RTC: calibration trim failed, RTC_ISR_INITF not set within [0-9]+ (milliseconds|seconds)",
  "domain": "embedded",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "RTC initialization flag (INITF) did not assert after setting INIT bit, likely due to ongoing backup domain write protection or clock source instability during calibration mode entry.",
  "root_cause_type": "generic",
  "root_cause_zh": "设置INIT位后RTC初始化标志(INITF)未置位，可能是由于校准模式进入期间备份域写保护持续激活或时钟源不稳定。",
  "versions": [
    {
      "version": "STM32Cube_FW_H7 v1.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ARM GCC v11.3.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "HAL RTC driver v2.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase timeout for INITF flag to 10 seconds",
      "why_fails": "Longer timeout does not fix the root cause; flag will never set if backup domain is locked or clock is missing.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Reset entire RTC peripheral by toggling RTCEN bit in RCC_BDCR",
      "why_fails": "Toggling RTCEN resets all RTC registers, losing time and date; calibration failure persists if write protection issue is not resolved.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure backup domain access is enabled before RTC calibration: call HAL_PWR_EnableBkUpAccess() and wait for PWR_CR1_DBP bit to be set. Then clear RTC_ISR_INITF by writing 0 to RTC_ISR after setting INIT bit.",
      "success_rate": 0.94,
      "how": "Ensure backup domain access is enabled before RTC calibration: call HAL_PWR_EnableBkUpAccess() and wait for PWR_CR1_DBP bit to be set. Then clear RTC_ISR_INITF by writing 0 to RTC_ISR after setting INIT bit.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use LSE clock bypass if external crystal is unstable: configure RCC_LSEConfig(RCC_LSE_ON) with bypass mode and verify LSERDY flag before entering calibration mode.",
      "success_rate": 0.87,
      "how": "Use LSE clock bypass if external crystal is unstable: configure RCC_LSEConfig(RCC_LSE_ON) with bypass mode and verify LSERDY flag before entering calibration mode.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在RTC校准前确保备份域访问已启用：调用HAL_PWR_EnableBkUpAccess()并等待PWR_CR1_DBP位置位。然后在设置INIT位后通过向RTC_ISR写入0来清除RTC_ISR_INITF。",
    "如果外部晶振不稳定，使用LSE时钟旁路：配置RCC_LSEConfig(RCC_LSE_ON)并启用旁路模式，在进入校准模式前验证LSERDY标志。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.st.com/resource/en/reference_manual/rm0433-stm32h743-and-stm32h753-arm-cortex-m7-32bit-mcu.pdf",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.91,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}