0

I have a Debian/Raspbian buster Linux on a Raspberry Pi 4 with isl1208 RTC attached. I think the RTC itself works: I can read it directly with a python script when kernel module disabled

systemd timedatectl

command shows RTC clock and

/sys/bus/i2c/devices/i2c-1/1-006f/rtc/rtc0/time

shows time.

But hwclock -r does not work:

$ sudo hwclock -r
hwclock: select() to /dev/rtc0 to wait for clock tick timed out

hwclock should be used during boot to set the system time from RTC.

Any ideas why hwclock -r does not work? Or should there be some other way to set system time from RTC during boot?

Edit 1:

It seems that systemd can read the RTC, because systemd-timedated only does read operation on /dev/rtc, which works fine.

hwclock -r before reading time from /dev/rtc first does synchronize_to_clock_tick_rtc where the process waits for the interrupt, which never comes.

So I wonder if that update interrupt should even work with isl1208 and RasPi, where there is only i2c connection between the RTC i2c IC and RasPi?

2
  • Does apt-get -y remove fake-hwclock solve the problem? May 4 '20 at 9:42
  • fake-hwclock was not installed (my system is very minimal, created with debootstrap)
    – user199309
    May 4 '20 at 9:50
1

A workaround is to use hwclock from busybox, which does not do the synchronization procedure.

0

Did you tried :

sudo i2cdetect -y 1

You should see a wall of text appear, if UU appears instead of 68 then we have successfully loaded in the Kernel driver for our RTC circuit

If your RTC is correct maybe you missed :

sudo hwclock -w

This command will write the time from the Raspberry Pi to the RTC Module.

Detailled steps : https://pimylifeup.com/raspberry-pi-rtc/ or https://www.instructables.com/id/Set-up-Real-Time-Clock-RTC-on-Raspberry-Pi/

2
  • Welcome to the site, and thank you for your contribution. Please note that "link-only" answers are discouraged as the external content can change or become unavailable. In its current form, your post should rather be a comment. Perhaps you can edit your post to summarize the most important steps you think the OP is missing, and include an explanation why you think these missing steps are the reason for the problem.
    – AdminBee
    May 7 '20 at 14:31
  • As implied by the original question, the kernel module is succesfully loaded and can communicate with the RTC for writing the time, and for some ways (with systemd-datetimed but not with hwclock), also reading the time.
    – user199309
    May 8 '20 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.