Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] STM32 drv_rtc.c #4627

Closed
mysterywolf opened this issue Apr 20, 2021 · 7 comments
Closed

[bug] STM32 drv_rtc.c #4627

mysterywolf opened this issue Apr 20, 2021 · 7 comments
Assignees
Labels
BSP: STM32 BSP related with ST/STM32 bug This PR/issue is a bug in the current code.

Comments

@mysterywolf
Copy link
Member

mysterywolf commented Apr 20, 2021

https://club.rt-thread.org/ask/question/430893.html

该问题已经被修复 #3591

@mysterywolf
Copy link
Member Author

mysterywolf commented May 26, 2021

https://club.rt-thread.org/ask/question/427284.html


更新 该问题已经解决 #3591

@mysterywolf
Copy link
Member Author

@icrazt
Copy link
Contributor

icrazt commented Jun 3, 2021

通过了解上面提到的问题

发现以下两种导致 RTC 使用出现问题的原因:

  1. 仅通过 menuconfig 开启 RTC 功能,但未在 CubeMX 中作相应配置。
  2. 受一个已修复 Bug1 的影响(在 PR 3137 中引入,在 PR 3591 中修复),持续时间从 2019-10-17 至 2020-05-12。

上面提到的问题可大致分类如下:

  1. 由于未配置 CubeMX,导致错误。但我在F401RE 与 F103ZET6 上测试时,未在 CubeMx 中配置会造成编译报错,和下面论坛提问中的现象不相符,原因未知。

  2. 受 Bug1 影响

  3. 未知原因:

@mysterywolf mysterywolf added the BSP: STM32 BSP related with ST/STM32 label Jul 27, 2021
@iysheng
Copy link
Contributor

iysheng commented Sep 30, 2021

我发现了一个问题在 stm32 的 bsp 中有大量的 RTC 配置在 board/board.c 文件中初始化为使用外部 LSE 使用作为 RTC 的时钟源.

这就会导致一个问题,当使用 menuconfig 选择了 LSI 作为 RTC 时钟,这时候就会导致在执行函数HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) 是因为时钟选择的不匹配导致 reset backup 寄存器,进一步导致读取的 backup 寄存器的值为 0x0 而打印未配置时间的错误信息:
.

@mysterywolf
Copy link
Member Author

mysterywolf commented Sep 30, 2021

10.5号更新 已经修改完成
stm32已完成修改,但是其他bsp也有存在这种问题还没有修改


d00307014adb038af1e698dc9a0cdf1
bsp/stm32/libraries/HAL_Drivers/drv_rtc.c
gmtime是非线程安全函数 建议改成gmtime_r函数

@mysterywolf
Copy link
Member Author

https://club.rt-thread.org/ask/article/3143.html
论坛报告新的问题

@mysterywolf
Copy link
Member Author

目前 只剩下了 #5116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BSP: STM32 BSP related with ST/STM32 bug This PR/issue is a bug in the current code.
Projects
None yet
Development

No branches or pull requests

6 participants