System Clock not Updating hardware clock during shutdown

Hi all,

I am working with on chip RTC on VF50 with angstrom running on it.I am able to update the system clock(OS clock) through a C program and able to display the updated system clock time and date using #date command.

But as stated in RTC documentation that during the system reboot the System Clock(Os clock) will update the hardware clock , my hardware clock is not getting updated during system reboot.
I am attaching the code that i am using to change the system clock.

Any suggestions how to rectify this problem.

Amitlink text


The system time is no longer copied into the RTC since image version 2.1 at shutdown. The systemd deamon timedated rather stores the time immediately whenever the time get change trough this deamon.

One way to use timedated is the command line tool timedatectl, another would be to use the dbus interface of timedated from a program.

Alternatively you could call hwclock -w each time you updated the system time with the date command or the
stime systemcall.


Please refer also to our RTC article:

Thanks Max,
I followed the above steps and my problem is solved.