RTC always reset to 19700101

cancel
Showing results for 
Search instead for 
Did you mean: 

RTC always reset to 19700101

142 Views
Contributor IV

Hi.

I find rtc on my board doesn't work well: it can be set by "hwclock -w" , but after reboot, it will be reset.

e.g.

root@imx6qsabresd:~# hwclock
Tue Jun 20 19:15:57 2017 0.000000 seconds
root@imx6qsabresd:~# date -s 20200101
Wed Jan 1 00:00:00 UTC 2020
root@imx6qsabresd:~# hwclock -w
root@imx6qsabresd:~# hwclock
Wed Jan 1 00:00:08 2020 0.000000 seconds
root@imx6qsabresd:~# reboot

...

snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 2020-01-01 00:01:19 UTC (1577836879)

...(cut off power,use button battery)

snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1)

Then I check the voltage when the power was changed, it's great. (3.29v to 3.08v)

So, are there somthing wrong in the code about rct initialization or others?

Regards

Mihan

Labels (1)
Tags (1)
0 Kudos
5 Replies

64 Views
NXP TechSupport
NXP TechSupport

Hi 铭恒 李

what bsp used in the case, one can try with linux from

source.codeaurora.org/external/imx/linux-imx  repository

linux-imx - i.MX Linux kernel 

For hardware one can check voltage on VDD_SNVS_CAP

with oscilloscope for possible glitches.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

64 Views
Contributor IV

I'm using 4.1.15-2.1.0. 

How to check the initialization of RTC in kernel

Yes, I checked the voltage with oscilloscope before, it has the minimum of 2.9v when I cut off the power.

0 Kudos

64 Views
NXP TechSupport
NXP TechSupport

please try to reproduce issue on i.MX6Q Sabre SD board

with Demo Images:

https://www.nxp.com/webapp/Download?colCode=L4.1.15_1.0.0_MX6QDLSOLO&appType=license 

If it can not be reproduced then issue in custom hardware, recheck board hardware design using

IMX6DQ6SDLHDG, Hardware Development Guide for i.MX 6Quad, 6Dual, 6DualLite, 6Solo Families of Applic...

Best regards
igor

0 Kudos

64 Views
Contributor IV

Hi 

Maybe I know the reason.

I set the on-cpu RTC off in menuconfig, then the rtc could not open.

So did I use on-cpu RTC before,not the external RTC?

0 Kudos

64 Views
Contributor IV

Hi 

I asked my friend about RTC, he said that maybe the backup area (BKP? but this is for stm32) was disable.

where should I check the RTC backup area in kernel code?

Let me explain the situation in detail.

This rtc is a external rtc(BM8563ESA),I'm using Imx6DL, kernel 4.1.15-2.1.0.

Now it’s always reset when register and read (snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1))

I think maybe the system will check the power off status bit then it will reset the rtc if true.\

So where is the check of power off status bit when initializing rtc?

0 Kudos