# RTC: Alarm A interrupt missed, trigger time 12:30:00 exceeded by 500ms

- **ID:** `embedded/rtc-alarm-interrupt-missed`
- **Domain:** embedded
- **Category:** runtime_error
- **Error Code:** `RTC_ALARM_MISS`
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

The RTC alarm interrupt was not serviced in time because a higher-priority interrupt or task delayed processing beyond the alarm window.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| STM32Cube_FW_H7 v1.11.0 | active | — | — |
| STM32Cube_FW_L4 v1.18.0 | active | — | — |
| RTC HAL Driver v2.0.0 | active | — | — |

## Workarounds

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.** (80% success)
   ```
   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.** (75% success)
   ```
   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.
   ```

## Dead Ends

- **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% fail)
- **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% fail)
