Board time not retained when board is re-started [ imx6 Apalis ]

Hi ,

We want the board to retain the time and date after we re-start the board.
Currently we are following
https://developer.toradex.com/knowledge-base/basic-linux-commands#timedatectl-set-clocks

After executing the steps mentioned here , we re-started the board ( had RTC battery of 3.3V ).
The board was having older values & not the required one.

Attached along is the snapshot :-

  1. setting-board-time.png [ steps to set the time ]
  2. time-after-restart.png [ board time not retaining after restart ]

We have used ( battery backed ) RTC so that the board retains the time .
alt text

Regards,
Deepak.

alt text

What exact hardware and software versions of things are you talking about? What carrier board?

BTW: Such screen shots are not really much helpful. Much better would be a textual log file of the serial console including the full boot process output.

Hi Marcel,
Thank you for the reply.

Please find the required details and the attached RTC debug log.

  1. What exact hardware :- T30 SOM + IXORA V1.0A Carrier board
  2. Software versions :- Linux apalis-t30 3.1.10
  3. What carrier board: IXORA V1.0A Carrier boardlink text
  4. Attached boot up logs(RTC_CLK_TegraT30_logs) after changing the time and date

Regards,
Deepak

hi deepak

Can you set up the time using following command:
timedatectl set-time "2019-01-01 00:00:00"

reboot and check the rtc and system time using the following commands: timedatectl && hwclock.
Check if the rtc time and system time are the same.

best regards, Jaski

Hi Jaski,

Thank you for the reply.

The command provided by you is throwing error and its not able to set the time.
Please find the attached error message.

Hi Jaski,

Thank you for the reply.

The command provided by you is not able to set the required time. i am getting below error:

root@apalis-t30:~#
root@apalis-t30:~#
root@apalis-t30:~# timedatectl set-time “2019-01-01 00:00:00”
Failed to set time: Automatic time synchronization is enabled
root@apalis-t30:~#
root@apalis-t30:~#

hi deepak

you need to disable the network time synchronization, as described on this site

best regards, jaski

Hi Jaski,

Sorry, Actually i after adding the logs in this mail body, logs was not properly aligned. So thought of attaching the logs but didn’t got that option, thats why i had deleted that previous response but i think you was able to see the logs.

Now after disabling the network time synchronization(from the suggested link) i am able to execute the command "timedatectl set-time “2019-01-01 00:00:00"”. After reboot time and date is changing but still problem coming while changing the previous or old year.

I tried below options to cross verify the time, date and year:

  1. Changing only time: After reboot time is retaining properly.
  2. Changing only date: After reboot date is retaining properly.
  3. Changing only month: After reboot month is retaining properly.
  4. Changing only Year: In this case particular once changing the year above the current year(eg. current year is 2018, so next years 2019, 2020…etc), so able to update the next years but not able to retain the previous years(eg. 2017, 2016…etc) after reboot.

So how to update the previous years?

Hi deepak

Actually if you set a time which is in future or after the time whether you made the software for your target, then everything is fine. But as in your case, if you set up a time which is in past, then the system time is reset by systemd to the time when your software image was made. This is a feature, since you cannot go back in time.

However the RTC time ( hwclock ) will be the one, which was set by you and could be also in past. If you need to set your systemclock absolutely to past, then you can set up a time using the timedatectl ... command and on startup synchronize the system clock to RTC using hwclock --systohc.

best regards, Jaski

Hi Jaski,

Thank you for providing this useful info.
So then it is an expected behavior.

If i want to change the time older than the S/W build then to synchronize the system clock to the RTC clock do i need to made the changes in the init scripts? Because i tried to change in bashrc bot i am not able to find the bashrc.
So is there any way to cross verify?

HI Deepak

Check this site please to set application at the start up in Linux!

best regards, Jaski

Hi Jaski,

Thank you. I will make the setup to cross verify this.