Hardware Clock Not Working

After restart the hwclock shows the following error:

hwclock: ioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argument

Which carrier board are you using ?

Can you provide the output of # dmesg | grep ‘rtc’ ?

Let us know if an changes done on top of the pre-build Linux image.

I am using Colibri evaluation v3.2A board.
Here is the dmesg|grep ‘rtc’ output

[ 1.285579] rtc-ds1307 0-0068: rtc core: registered m41t00 as rtc0
[ 1.300147] snvs_rtc 400a7000.snvs:snvs-rtc-lp: rtc core: registered 400a7000.snvs:snvs- as rtc1
[ 2.603816] rtc-ds1307 0-0068: hctosys: unable to read the hardware clock

I am using ubuntu root filesystem.

Did you actually ever set the clock to a valid value as e.g. indicated here.

Yes I did it.But after restart the problem remains same.

And your JP23 is set to 2-3 aka EXT RTC and a known good battery is inserted in BAT1 as well?

I think there is no battery in BAT1 socket.I didn’t inserted anything in the board.

What to do now.Please tell.

Well, as stated above please do insert a known good battery, set JP23 to 2-3 and at least once actually set a valid time e.g. by using hwclock -w.

To give some background to the error message: The kernel verifies the time read from the RTC clock (in rtc_valid_tm drivers/rtc/rtc-lib.c) and return EINVAL (Invalid Argument) in case the time is not valid. As @marcel.tx pointed out, the clock needs to be set and the coin battery need to be in place so the RTC clock can keep the clock. Otherwise, the RTC simply looses time leading to this error message.