Skip to content
Get 5% off your entire order with a minimum purchase of $30 – automatically applied at checkout ! Black Friday Exclusive Deals Await!
X728 Pi4 RTC not working | Geekworm

X728 Pi4 RTC not working


  • I purchased the X728 ups hat to be used with a Pi 4.
    I am having issues with RTC.
    I'm running Ubuntu Server 20.04.
     
    To rule out issues as my fault, here is what I did:
     - in /boot/firmware/usercfg.txt i have added:
     - dtparam=i2c_arm=on
     - dtoverlay=i2c-rtc,ds1307
     
    ls -l /dev/i2c*
    crw-rw---- 1 root i2c 89, 1 Apr  1  2020 /dev/i2c-1
     
    ls -la /dev/rt*
    lrwxrwxrwx 1 root root      4 Apr  1  2020 /dev/rtc -> rtc0
    crw------- 1 root root 248, 0 Apr  1  2020 /dev/rtc0
     
    sudo i2cdetect -y 1
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --  
     
    sudo hwclock -v
    hwclock from util-linux 2.34
    System Time: 1608303236.603336
    Trying to open: /dev/rtc0
    Using the rtc interface to the clock.
    Assuming hardware clock is kept in UTC time.
    Waiting for clock tick...
    ioctl(4, RTC_UIE_ON, 0): Invalid argument
    Waiting in loop for time from /dev/rtc0 to change
    hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Connection timed out
    ...synchronization failed
     
    sudo dmesg | grep -i rtc
    [    0.000000] Kernel command line:  coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 smsc95xx.macaddr=DC:A6:32:A4:B5:B5 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  net.ifnames=0 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc quiet splash
    [    1.861664] hctosys: unable to open rtc device (rtc0)
    [    2.460567] rtc-ds1307 1-0068: registered as rtc0
    [   25.962250] rtc-ds1307 1-0068: read error -110
    [   26.986155] rtc-ds1307 1-0068: read error -110
    [   35.562185] rtc-ds1307 1-0068: read error -110
    [   36.586157] rtc-ds1307 1-0068: read error -110
    [   37.610264] rtc-ds1307 1-0068: read error -110
    [   52.138424] rtc-ds1307 1-0068: write error -110
    [   53.162442] rtc-ds1307 1-0068: read error -110
     
     
    The TTY is also getting flooded with:
     i2c-bcm2835 : i2c transfer timed out
    rtc-ds1307 1-0068: write error -110
     
     
    Is this a bad board?
    Please advise.
     


  • Tested on Raspberry OS lite. Seems to work.

     

    sudo hwclock -v

    hwclock from util-linux 2.33.1

    System Time: 1608307733.168204

    Trying to open: /dev/rtc0

    Using the rtc interface to the clock.

    Last drift adjustment done at 1608307717 seconds after 1969

    Last calibration done at 1608307717 seconds after 1969

    Hardware clock is on UTC time

    Assuming hardware clock is kept in UTC time.

    Waiting for clock tick...

    ioctl(4, RTC_UIE_ON, 0): Invalid argument

    Waiting in loop for time from /dev/rtc0 to change

    ...got clock tick

    Time read from Hardware Clock: 2020/12/18 16:08:54

    Hw clock time : 2020/12/18 16:08:54 = 1608307734 seconds since 1969

    Time since last adjustment is 17 seconds

    Calculated Hardware Clock drift is 0.000000 seconds

    2020-12-18 16:08:53.160769+00:00

     

    But why doesn't it work with Ubuntu?


  • Apparenly on a freshly installed Ubuntu it works.

    Interesting...


Please login to reply this topic!