RTC_ALARM_MISS
embedded
runtime_error
ai_generated
true
RTC: 报警A中断丢失,触发时间12:30:00已超过500ms
RTC: Alarm A interrupt missed, trigger time 12:30:00 exceeded by 500ms
ID: embedded/rtc-alarm-interrupt-missed
78%修复率
83%置信度
1证据数
2024-01-22首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| STM32Cube_FW_H7 v1.11.0 | active | — | — | — |
| STM32Cube_FW_L4 v1.18.0 | active | — | — | — |
| RTC HAL Driver v2.0.0 | active | — | — | — |
根因分析
RTC报警中断未能及时服务,因为更高优先级的中断或任务延迟了处理,超过了报警窗口。
English
The RTC alarm interrupt was not serviced in time because a higher-priority interrupt or task delayed processing beyond the alarm window.
官方文档
https://www.st.com/resource/en/reference_manual/rm0383-stm32f411xce-reference-manual-stmicroelectronics.pdf解决方案
-
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.
-
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
90% 失败
The alarm is a one-shot event; changing the prescaler does not affect the interrupt latency for a single trigger.
-
Disable all other interrupts to give RTC priority
85% 失败
Disabling other interrupts can break critical system functions like timers or communication; it is not a sustainable fix.