# RTC: 报警A中断丢失，触发时间12:30:00已超过500ms

- **ID:** `embedded/rtc-alarm-interrupt-missed`
- **领域:** embedded
- **类别:** runtime_error
- **错误码:** `RTC_ALARM_MISS`
- **验证级别:** ai_generated
- **修复率:** 78%

## 根因

RTC报警中断未能及时服务，因为更高优先级的中断或任务延迟了处理，超过了报警窗口。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| STM32Cube_FW_H7 v1.11.0 | active | — | — |
| STM32Cube_FW_L4 v1.18.0 | active | — | — |
| RTC HAL Driver v2.0.0 | active | — | — |

## 解决方案

1. ```
   Set the RTC alarm interrupt priority to the highest level (e.g., NVIC_SetPriority(RTC_Alarm_IRQn, 0)) and ensure no other interrupt uses the same priority group.
   ```
2. ```
   Use a polling-based approach instead of interrupts: check the RTC alarm flag in the main loop every 10ms with HAL_RTC_GetAlarmFlag() and handle the event there.
   ```

## 无效尝试

- **Increase the RTC alarm prescaler to reduce interrupt frequency** — The alarm is a one-shot event; changing the prescaler does not affect the interrupt latency for a single trigger. (90% 失败率)
- **Disable all other interrupts to give RTC priority** — Disabling other interrupts can break critical system functions like timers or communication; it is not a sustainable fix. (85% 失败率)
