This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTC does not increment

Other Parts Discussed in Thread: OMAPL138

Hello,


In OMAPL138(ARM Linux), by using hwclock -w command, we are able to set Date and Time in RTC and this is verified by hwclock -r command. But when we keep executing hwclock -r command frequently, seconds does not increment that means RTC is not running and hence there is no change in time for ever. Please help us to resolve the issue.

Rgds,

RameshBabu

  • Hi RameshBabu,

    What do you say about "date" command in linux ?

    Have you tried the "date" command to read the date & time & checked the same behavior after you saved the time in RTC HW through "hwclock -w" ?

    Try "date" command continuously instead of using "hwclock -r" ?

  • Hello Titu,

    Date command is working fine. We are able to set and read Linux system time using date command and it is running properly.

    Actually during bootup, Linux reads time from RTC and updates to Linux system time. Since RTC does not run, whenever we power off and power on the Unit, date command reads the old RTC time. This is the problem..

    Rgds,

    Ramesh

  • Hello Titus,

    This is in continuation to my first reply to you.

    Once Linux boots up, We set time using date command and use hwclock -w to update to RTC. After when we check using date command, it increments time. But hwclock -r does not increment, rather holds the set value.

    Rgds,

    Ramesh

  • Hi Ramesh,

    But when we keep executing hwclock -r command frequently, seconds does not increment that means RTC is not running and hence there is no change in time for ever. Please help us to resolve the issue.

    Actually during bootup, Linux reads time from RTC and updates to Linux system time. Since RTC does not run, whenever we power off and power on the Unit, date command reads the old RTC time. This is the problem..

    I'm seeing some difference on your statement & conveying the problem.

    Could you please bit a elaborate on your problem ?

    If you are using "hwlock -r" frequently & getting the problem then you can try to reproduce the same problem with trying "date" command continuously.

    Or you can avoid the "hwclokc -r " issue by trying the "date" command.

    Got my point here ?

    I can understand that if "date" command issue fix this, also we should know why "hwclock -r" command gives the read error right ?

    Are you able to reproduce the problem on different boards ?

    Are you getting the problem when resetting the board or power ON & OFF ?

    I also suspect that the problem is may be due to hardware of RTC power section.

    Some times, when we reset the board, RTC caps would get glitch so RTC power fail happens and RTC loose the date info.