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

新版本的 NTP 同步无法同步日期只能同步时间 #69

Closed
majianjia opened this issue May 22, 2021 · 4 comments
Closed

新版本的 NTP 同步无法同步日期只能同步时间 #69

majianjia opened this issue May 22, 2021 · 4 comments

Comments

@majianjia
Copy link

涉及到这次改动:1e02f87

源文件377行设置date和time分别用了两次localtime. 新版删掉后导致NTP 同步无法同步日期只能同步时间

单步调试发现,先进行set_time的情况下,set_time之后,日期被重置,时间保留。
我现在先设置日期,再设置时间,可以同步日期并且同步时间。

获取时间正确。
image
年月被重置成RTC原先的时间。
image

这个问题可能跟底层RTC驱动有关。
STM32L476

@mysterywolf
Copy link
Member

这个应该是底层的问题 RT-Thread/rt-thread#4627
新版的NTP同步的不是日期或者时间,只同步UNI时间戳,这个东西是包含着日期和事件的,如果数据装订不进去,说明底层有问题了;此前我已经察觉到了drv_rtc.c有问题,有论坛的人反应过这个问题。

@mysterywolf
Copy link
Member

能考虑给rt-thread master 提个pr吗 我对HAL库不太熟悉

@majianjia
Copy link
Author

能考虑给rt-thread master 提个pr吗 我对HAL库不太熟悉

我也不太熟悉,我有空的话看看。

@majianjia
Copy link
Author

已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants