RTC shield stopped working after 18.04 kernel update

Moderators: odroid, mdrjr

RTC shield stopped working after 18.04 kernel update

Unread postby astromeier » Wed Oct 03, 2018 3:27 am

Hi RTC guys!
My original RTC shield stopped working after the last Ubuntu 18.04 kernel update:
linux-odroid-c2 (3.16.58-26) over (3.16.57-25)

The clock worked before, I followed the installation and "Kernel update will break the RTC functionality" directives in the wiki.

The shield is not dead: a odroid C2 Ubuntu 16.04 system could use the RTC.

Has anyone experienced the same behavior or can give some tips for searching the bug?

hfh
Thomas
astromeier
 
Posts: 5
Joined: Tue Dec 20, 2016 5:48 am
languages_spoken: english
ODROIDs: C2, XU4

Re: RTC shield stopped working after 18.04 kernel update

Unread postby astromeier » Wed Oct 03, 2018 3:42 am

... for those without a crystal ball:

Code: Select all
thomas@HASS8GB:~$ hwclock --debug
hwclock from util-linux 2.31.1
System Time: 1538505369.113057
Trying to open: /dev/rtc0
Trying to open: /dev/rtc
Trying to open: /dev/misc/rtc
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.


and

Code: Select all
thomas@HASS8GB:~$ lsmod
Module                  Size  Used by
w1_therm                3356  0
w1_gpio                 3801  0
wire                   28606  2 w1_gpio,w1_therm
meson_gpiomem           4048  0
gxbb_wdt                3395  0
sch_fq_codel            7827  2
rtc_pcf8563             3924  0
sx865x                  5179  0
aml_i2c                16735  0
ip_tables              17220  0
ipv6                  387345  18
autofs4                27592  2
astromeier
 
Posts: 5
Joined: Tue Dec 20, 2016 5:48 am
languages_spoken: english
ODROIDs: C2, XU4

Re: RTC shield stopped working after 18.04 kernel update

Unread postby rooted » Wed Oct 03, 2018 5:06 am

Try

Code: Select all
zcat /proc/config.gz | grep RTC
User avatar
rooted
 
Posts: 5885
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: RTC shield stopped working after 18.04 kernel update

Unread postby joshua.yang » Thu Oct 04, 2018 6:06 pm

Hi,

I just tested C2 18.04 with 3.16.58-26 kernel + RTC Shield.
And it looks work without any noticeable issue.

I followed Wiki guide (https://wiki.odroid.com/accessory/add-o ... eld#ubuntu), and additionally did "Kernel update will break the RTC functionality" directives before the first reboot.

This is my results using hwclock.
Code: Select all
odroid@odroid:~$ date               
Thu Oct  4 09:02:00 UTC 2018
odroid@odroid:~$ sudo hwclock -w
odroid@odroid:~$ sudo hwclock --debug
hwclock from util-linux 2.31.1
System Time: 1538643732.351608
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1538643728 seconds after 1969
Last calibration done at 1538643728 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: 2018/10/04 09:02:13
Hw clock time : 2018/10/04 09:02:13 = 1538643733 seconds since 1969
Time since last adjustment is 5 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2018-10-04 09:02:12.745865+0000
odroid@odroid:~$ sudo hwclock -r
2018-10-04 09:02:23.830394+0000
odroid@odroid:~$ uname -a
Linux odroid 3.16.58-26 #1 SMP PREEMPT Sun Sep 30 23:40:07 -03 2018 aarch64 aarch64 aarch64 GNU/Linux
odroid@odroid:~$


Well, could you try again with sudo command?
joshua.yang
 
Posts: 107
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: English
ODROIDs: XU4, XU4Q + Cloudshell2

Re: RTC shield stopped working after 18.04 kernel update

Unread postby astromeier » Tue Oct 09, 2018 3:39 am

Thanks for the answers!

@joshua.yang
Thanks for testing and information!

@rooted:
Thanks for your hint!
I cannot find anything uncommon:

Code: Select all
thomas@HASS8GB:~$ zcat /proc/config.gz | grep RTC
# CONFIG_AML_RTC is not set
CONFIG_AML_VRTC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set
# RTC interfaces
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set
# I2C RTC drivers
CONFIG_RTC_DRV_DS1307=m
CONFIG_RTC_DRV_DS1374=m
CONFIG_RTC_DRV_DS1672=m
CONFIG_RTC_DRV_DS3232=m
# CONFIG_RTC_DRV_HYM8563 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_ISL12057 is not set
# CONFIG_RTC_DRV_X1205 is not set
CONFIG_RTC_DRV_PCF2127=m
# CONFIG_RTC_DRV_PCF8523 is not set
CONFIG_RTC_DRV_PCF8563=m
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set
# SPI RTC drivers
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1343 is not set
# CONFIG_RTC_DRV_DS1347 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_DS3234 is not set
# CONFIG_RTC_DRV_PCF2123 is not set
# CONFIG_RTC_DRV_RX4581 is not set
# CONFIG_RTC_DRV_MCP795 is not set
# Platform RTC drivers
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
# CONFIG_RTC_DRV_DS2404 is not set
# on-CPU RTC drivers
# CONFIG_RTC_DRV_PL030 is not set
CONFIG_RTC_DRV_PL031=y
# CONFIG_RTC_DRV_SNVS is not set
# CONFIG_RTC_DRV_MOXART is not set
# CONFIG_RTC_DRV_XGENE is not set
# HID Sensor RTC drivers
# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set
astromeier
 
Posts: 5
Joined: Tue Dec 20, 2016 5:48 am
languages_spoken: english
ODROIDs: C2, XU4

Re: RTC shield stopped working after 18.04 kernel update

Unread postby astromeier » Tue Oct 09, 2018 3:52 am

Okay - RTC is back again!
I repeated the steps shown in the wiki:
odroid@odroid:~$ sudo apt install device-tree-compiler (the compiler was installed - no new install or Update performed)
odroid@odroid:~$ sudo fdtput -t s /media/boot/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"

Then i checked /etc/modules - all right there...

A reboot brought back the RTC function...

Again I performed the steps in the box "Kernel update will break the RTC functionality "

... waiting for next kernel update ;-)

Thx to all contributors!!

Thomas
astromeier
 
Posts: 5
Joined: Tue Dec 20, 2016 5:48 am
languages_spoken: english
ODROIDs: C2, XU4

Re: RTC shield stopped working after 18.04 kernel update

Unread postby astromeier » Tue Oct 09, 2018 4:02 am

... and now found a difference in the wiki :
The first installation steps:
fdtput -t s /media/boot/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"

The box description for making the RTC function persistent:
fdtput -t s /boot/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"

... there is /media missing in front of the path...

I fixed this in the rtc file in /etc/kernel/postinst.d
astromeier
 
Posts: 5
Joined: Tue Dec 20, 2016 5:48 am
languages_spoken: english
ODROIDs: C2, XU4

Re: RTC shield stopped working after 18.04 kernel update

Unread postby joshua.yang » Thu Oct 11, 2018 11:13 am

astromeier wrote:... and now found a difference in the wiki :
The first installation steps:
fdtput -t s /media/boot/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"

The box description for making the RTC function persistent:
fdtput -t s /boot/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status "okay"

... there is /media missing in front of the path...

I fixed this in the rtc file in /etc/kernel/postinst.d


Okay, we fixed it. Thanks. :)
joshua.yang
 
Posts: 107
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: English
ODROIDs: XU4, XU4Q + Cloudshell2


Return to Hardware and peripherals

Who is online

Users browsing this forum: Bing [Bot] and 10 guests