How the date or time is implemented in Linux SC58x

Hi,

Usually, I can use the CLI date command to check the running time..

But, I have a situation that the data command return 0 after 18 hours of running of my platform..

Any suggestion on how to debug this issue ?

In general, how the date command get the timing information from the hardware and Linux driver ?

Thanks

ACS



tagged
[edited by: JValeriani at 7:47 PM (GMT 0) on 9 Oct 2019]
Parents
  • +1
    •  Analog Employees 
    on Oct 9, 2019 8:53 AM

    Hi ,

    It works well locally on sc589-ezkit board with Linux add-in 1.3.1 after 18 hours of running:

    Welcome to Buildroot
    buildroot login: root
    Password:

    _______________________________________
    a8888b. / Welcome to the buildroot distribution \
    d888888b. / _ _ \
    8P"YP"Y88 / | | |_| __ __ (TM) |
    8|o||o|88 _____/ | | _ ____ _ _ \ \/ / |
    8' .88 \ | | | | _ \| | | | \ / |
    8`._.' Y8. \ | |__ | | | | | |_| | / \ |
    d/ `8b. \ \____||_|_| |_|\____|/_/\_\ |
    dP . Y8b. \ For embedded processors including |
    d8:' " `::88b \ the Analog Devices ADSP-SC5xx /
    d8" 'Y88b \_____________________________________/
    :8P ' :888
    8a. : _a88P For further information, check out:
    ._/"Yaa_: .| 88P|
    \ YP" `| 8P `.
    / \.___.d| .' - http://buildroot.org/
    `--..__)8888P`._.' jgs/a:f - http://www.analog.com/

    Have a lot of fun...
    # cd /
    # date
    Thu Jan 1 01:29:51 UTC 1970
    # date
    Thu Jan 1 01:29:52 UTC 1970
    #
    # date
    Thu Jan 1 03:39:07 UTC 1970
    #
    #
    # date
    Thu Jan 1 18:59:51 UTC 1970
    # date
    Thu Jan 1 19:25:04 UTC 1970
    # cat /proc/version
    Linux version 4.0.0-ADI-1.3.1 (test@119-test-build) (gcc version 4.8.3 (Analog 9
    # date
    Thu Jan 1 19:25:36 UTC 1970
    # date
    Thu Jan 1 19:36:31 UTC 1970
    # date
    Thu Jan 1 21:32:33 UTC 1970
    # date
    Thu Jan 1 22:37:46 UTC 1970
    # date
    Thu Jan 1 22:42:17 UTC 1970
    # date

    Could you please help to double check it?

    "date" command will display or set the Linux system time, and another Linux command "hwclock" will query and set the hardware clock(RTC), normally the Linux RTC subsystem will set the system clock according with the hardware clock(RTC) on startup, you can refer to "linux-kernel/drivers/rtc/hctosys.c" for more information, below is the boot log:

    console [netcon0] enabled
    netconsole: network logging started
    rtc-adi2 310c8000.rtc: setting system clock to 1970-01-01 01:29:15 UTC (5355)
    IP-Config: Complete:
    device=eth0, hwaddr=02:80:ad:20:31:e8, ipaddr=10.99.24.73, mask=255.255.251
    host=sc58x, domain=, nis-domain=(none)
    bootserver=10.99.24.66, rootserver=10.99.24.66, rootpath=

    Thanks a lot.

Reply
  • +1
    •  Analog Employees 
    on Oct 9, 2019 8:53 AM

    Hi ,

    It works well locally on sc589-ezkit board with Linux add-in 1.3.1 after 18 hours of running:

    Welcome to Buildroot
    buildroot login: root
    Password:

    _______________________________________
    a8888b. / Welcome to the buildroot distribution \
    d888888b. / _ _ \
    8P"YP"Y88 / | | |_| __ __ (TM) |
    8|o||o|88 _____/ | | _ ____ _ _ \ \/ / |
    8' .88 \ | | | | _ \| | | | \ / |
    8`._.' Y8. \ | |__ | | | | | |_| | / \ |
    d/ `8b. \ \____||_|_| |_|\____|/_/\_\ |
    dP . Y8b. \ For embedded processors including |
    d8:' " `::88b \ the Analog Devices ADSP-SC5xx /
    d8" 'Y88b \_____________________________________/
    :8P ' :888
    8a. : _a88P For further information, check out:
    ._/"Yaa_: .| 88P|
    \ YP" `| 8P `.
    / \.___.d| .' - http://buildroot.org/
    `--..__)8888P`._.' jgs/a:f - http://www.analog.com/

    Have a lot of fun...
    # cd /
    # date
    Thu Jan 1 01:29:51 UTC 1970
    # date
    Thu Jan 1 01:29:52 UTC 1970
    #
    # date
    Thu Jan 1 03:39:07 UTC 1970
    #
    #
    # date
    Thu Jan 1 18:59:51 UTC 1970
    # date
    Thu Jan 1 19:25:04 UTC 1970
    # cat /proc/version
    Linux version 4.0.0-ADI-1.3.1 (test@119-test-build) (gcc version 4.8.3 (Analog 9
    # date
    Thu Jan 1 19:25:36 UTC 1970
    # date
    Thu Jan 1 19:36:31 UTC 1970
    # date
    Thu Jan 1 21:32:33 UTC 1970
    # date
    Thu Jan 1 22:37:46 UTC 1970
    # date
    Thu Jan 1 22:42:17 UTC 1970
    # date

    Could you please help to double check it?

    "date" command will display or set the Linux system time, and another Linux command "hwclock" will query and set the hardware clock(RTC), normally the Linux RTC subsystem will set the system clock according with the hardware clock(RTC) on startup, you can refer to "linux-kernel/drivers/rtc/hctosys.c" for more information, below is the boot log:

    console [netcon0] enabled
    netconsole: network logging started
    rtc-adi2 310c8000.rtc: setting system clock to 1970-01-01 01:29:15 UTC (5355)
    IP-Config: Complete:
    device=eth0, hwaddr=02:80:ad:20:31:e8, ipaddr=10.99.24.73, mask=255.255.251
    host=sc58x, domain=, nis-domain=(none)
    bootserver=10.99.24.66, rootserver=10.99.24.66, rootpath=

    Thanks a lot.

Children