Hi community,
I am trying to use Real Time Clock on a imx6 Dual Lite based board.
The setup is the following:
rootfs built with yocto master-next, image based on fsl-image-multimedia and linux kernel is 3.10.31 BETA.
I activated the RTC support in linux kernel (Device Drivers → Real Time Clock → Freescale SNVS RTC support), and now, I have a "rtc and "rtc0" in /dev.
My issue:
-I use a ntp server to set system clock
-"hwclock -w" to set the RTC
-I unplug board supply.
-Wait 5 min
-I plug board supply
-RTC and system clock have the same hour but they aren't at the right hour.
Could you help me, please?
Merry Christmas,
Jordan
I have the exact same problem on an i.MX6S. I set the date, then run hwclock --systohc. When I reboot the system, the date is not saved. If I use the poweroff command, it works properly, but that doesn't work for my use case.
Did anyone figure out the answer to this question?
Hi,
When you use "poweroff" command, the script /etc/init.d/save-rtc.sh is execute and it save RTC value on /etc/timestamp file. This file restore the RTC at reboot if the RTC has a bad value.
And to solve your problem, read discussions above where I explained my modification on linux kernel and check if the pcf2123 is present on your board (because rtc wasn't present on mine)
Regards,
Jordan
Hi,
I tested "dizzy" but I had an error when I launched "bitbake": ERROR: Layer 'networking-layer' depends on layer 'meta-python'
Thus, I tried the "daisy" branch and I have the same original problem (RTC no backup). More, I tried on a second imx6 Dual Lite: same issue.
Is it usefull to try with "dizzy"? if no, others solutions?
Regards,
Jordan
Hi Jordan,
did you find any solution for this issue?
I also have an i.MX6 Dual Lite CPU here with Linux Kernel 3.0.35 and Buildroot 2015.02 rootfs and i have exactly the same problem:
When i read the RTC (hwclock --show) after a reboot it always returns something like "Thu Jan 1 00:00:27 1970 0.000000 seconds".
Any clue what i'm doing wrong?
Best regards,
Michael
Hi,
I have a box which is created by SECO Embedded creators society and on my board, the internal RTC isn't maintained but I have an external PCF2123 RTC which is connected by SPI bus (ecspi3).
Thus, firstly: activate the PCF2123 module in kernel configuration
Secondly : Modify the dts file which you use, to connect SPI and RTC PCF2123
&ecspi3 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio4 24 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi3_1>;
status = "okay";
rtc: pcf2123@0 {
compatible = "nxp,rtc-pcf2123";
spi-max-frequency = <1000000>;
spi-cs-high;
reg = <0>;
};
};
Hoping this helps you
Regards,
Jordan
Hi Jordan,
thanks for your hint! I'm using a µQ7 i.MX 6 Module from (guess who?) SECO!
I'll try to get the PCF2123 working.
Best regards,
Michael
Hi,
First of all, check if the pcf2123 is present on your µQ7 i.MX 6 Module because on mine, this wasn't the case.
Regards,
Jordan
Hi Jordan,
same issue here: no pcf2123 present on module... :smileysad: Need to order new modules.
Thanks for your support!
Best regards,
Michael
what is about testing that on Freescale reference Sabre board,
can this be reproduced ?
Also one can try ltib L3.0.35_4.1.0_ER_SOURCE_BSP ,
Best regards
igor
Hi jordan
do you have backup battery attached to VDD_SNVS_IN ?
Best regards
igor
Hi Igor,
Yes, I have a 3 Volts backup battery.
Jordan
Hi jordan
I think you can try latest dizzy
FSL Community BSP Release Notes 1.7 documentation
Also one can run imx-test rtc unit test (mxc_rtc), FSL-UT-RTC-003.txt
describes it as follows:
| Test Procedure |
Test whether target is able to resume from standyby by RTC wakeup
.Test steps
. Boot-up Linux kernel.
. Type the command "date". It should return something like this "Thu Jan 1 00:00:30 UTC 1970".
. Set the date to the current date and time. The command is "date yyyyMMDDhhmm" such as "date 201012091453" for 12/03/2010 14:53
. Set the HW clock to current date and time by using the command "hwclock --systohc"
. Make sure the new date and time are set by issuing "date" and then "hwclock --show"
. Shutdown the system, including a power-cycle. You can use "poweroff" command
. Restart the system with the Linux kernel. Run "date" command.
| Expected Result |
Check whether the date is reserved and right.
Best regards
igor
Hi,
When I follow this procedure with the master-next branch, I have the same issue I had describe in first.
I'll test the dizzy branch.
Regards,
Jordan