embedded config_error ai_generated true

RTC:校准调整失败,RTC_ISR_INITF在2秒内未置位

RTC: calibration trim failed, RTC_ISR_INITF not set within 2 seconds

ID: embedded/rtc-calibration-trim-failed

其他格式: JSON · Markdown 中文 · English
91%修复率
86%置信度
1证据数
2023-09-05首次发现

版本兼容性

版本状态引入弃用备注
STM32Cube_FW_H7 v1.9.0 active
ARM GCC v11.3.1 active
HAL RTC driver v2.6.0 active

根因分析

设置INIT位后RTC初始化标志(INITF)未置位,可能是由于校准模式进入期间备份域写保护持续激活或时钟源不稳定。

English

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.

generic

官方文档

https://www.st.com/resource/en/reference_manual/rm0433-stm32h743-and-stm32h753-arm-cortex-m7-32bit-mcu.pdf

解决方案

  1. 在RTC校准前确保备份域访问已启用:调用HAL_PWR_EnableBkUpAccess()并等待PWR_CR1_DBP位置位。然后在设置INIT位后通过向RTC_ISR写入0来清除RTC_ISR_INITF。
  2. 如果外部晶振不稳定,使用LSE时钟旁路:配置RCC_LSEConfig(RCC_LSE_ON)并启用旁路模式,在进入校准模式前验证LSERDY标志。

无效尝试

常见但无效的做法:

  1. Increase timeout for INITF flag to 10 seconds 95% 失败

    Longer timeout does not fix the root cause; flag will never set if backup domain is locked or clock is missing.

  2. Reset entire RTC peripheral by toggling RTCEN bit in RCC_BDCR 80% 失败

    Toggling RTCEN resets all RTC registers, losing time and date; calibration failure persists if write protection issue is not resolved.