Real Time Clock doesn't work on imx6 Dual Lite

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Real Time Clock doesn't work on imx6 Dual Lite

7,415 Views
jordan38
Contributor II

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

Labels (3)
Tags (3)
0 Kudos
13 Replies

2,496 Views
marlonsmith
Contributor IV

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?

0 Kudos

2,496 Views
jordan38
Contributor II

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

0 Kudos

2,496 Views
jordan38
Contributor II

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

0 Kudos

2,496 Views
mihe
Contributor I

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

0 Kudos

2,496 Views
jordan38
Contributor II

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

0 Kudos

2,495 Views
mihe
Contributor I

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

0 Kudos

2,496 Views
jordan38
Contributor II

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

0 Kudos

2,496 Views
mihe
Contributor I

Hi Jordan,

same issue here: no pcf2123 present on module... :smileysad: Need to order new modules.

Thanks for your support!

Best regards,

Michael

0 Kudos

2,496 Views
igorpadykov
NXP Employee
NXP Employee

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 ,

L3.0.35_4.1.0_DEMO_IMAGE_BSP

Best regards

igor

0 Kudos

2,496 Views
igorpadykov
NXP Employee
NXP Employee

Hi jordan

do you have backup battery attached to VDD_SNVS_IN ?

Best regards

igor

0 Kudos

2,496 Views
jordan38
Contributor II

Hi Igor,

Yes, I have a 3 Volts backup battery.

Jordan

0 Kudos

2,496 Views
igorpadykov
NXP Employee
NXP Employee

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

0 Kudos

2,496 Views
jordan38
Contributor II

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

0 Kudos