{
  "id": "embedded/rtc-alarm-interrupt-not-triggering",
  "signature": "RTC: alarm interrupt not triggering at configured time",
  "signature_zh": "RTC：闹钟中断未在配置时间触发",
  "regex": "RTC: alarm interrupt not triggering at configured time",
  "domain": "embedded",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "RTC alarm interrupt failed to fire due to incorrect mask configuration or pending interrupt flag not cleared.",
  "root_cause_type": "generic",
  "root_cause_zh": "RTC 闹钟中断因掩码配置错误或未清除挂起中断标志而未触发。",
  "versions": [
    {
      "version": "STM32Cube_FW_H7 V1.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "FreeRTOS V10.4.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing RTC clock prescaler changes alarm timing but does not fix interrupt configuration.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Reinitializing RTC peripheral resets all registers, losing alarm settings.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding delay loops after alarm set does not address missing interrupt enable.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check and clear RTC_ISR_ALRAF flag in RTC_ISR register before setting alarm, then enable alarm interrupt in RTC_CR: `RTC->CR |= RTC_CR_ALRAIE;`",
      "success_rate": 0.9,
      "how": "Check and clear RTC_ISR_ALRAF flag in RTC_ISR register before setting alarm, then enable alarm interrupt in RTC_CR: `RTC->CR |= RTC_CR_ALRAIE;`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure RTC alarm mask bits (ALRAE, ALRABIN) in RTC_CR are set correctly for desired alarm mode.",
      "success_rate": 0.85,
      "how": "Ensure RTC alarm mask bits (ALRAE, ALRABIN) in RTC_CR are set correctly for desired alarm mode.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use HAL_RTC_AlarmIRQHandler() which automatically clears pending flags and re-enables interrupt.",
      "success_rate": 0.95,
      "how": "Use HAL_RTC_AlarmIRQHandler() which automatically clears pending flags and re-enables interrupt.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在设置闹钟前检查并清除 RTC_ISR 中的 RTC_ISR_ALRAF 标志，然后在 RTC_CR 中使能闹钟中断：`RTC->CR |= RTC_CR_ALRAIE;`",
    "确保 RTC_CR 中的闹钟掩码位（ALRAE、ALRABIN）正确配置为所需闹钟模式。",
    "使用 HAL_RTC_AlarmIRQHandler() 函数，它会自动清除挂起标志并重新使能中断。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.st.com/resource/en/reference_manual/dm00314099.pdf",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-02-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}