[SOLVED] [Raspberry_Pi] RTC Clock Support?

Home Forums Feedback [SOLVED] [Raspberry_Pi] RTC Clock Support?

This topic contains 5 replies, has 2 voices, and was last updated by  Linux_Guy 6 years, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #6621


    Hello, and again thank you for porting to the Raspberry Pi.
    Is there any way to get a kernel build that will support a Real Time Clock (RTC)?
    I have a pcf2127a clock and would love to make it work instead of the ntp.
    The npt requests are filling my firewall logs in my router-server (Smoothwall.org).
    I had built a kernel module for the RTC for rasbian, but I don’t see any provision for
    the module under /lib/modules/ Am I missing something?



    Warped Rudi

    We recently added support for this module. It features a PCF2129A in I2C mode (address 0x51). If the PCF2127A on your module is also connected to I2C (and not to SPI), you might want to try snapshot r16285 or later. With this, the “hwclock” command on the console should work. In order to let the system make use of that you need to run “systemctl unmask hwclock-sync” once.

    BTW, which kernel module did you use on Raspbian ?



    I am currently running r16294.
    The RTC kernel module I built from the latest rpi-3.6.y source ( from Raspberry Pi
    I have the RTC connected via I2C.
    The RTC is from ModMyPi….they got it from:

    instead of downloading a new image for the kernel, I built the module and inmod
    as was suggested in one of the replies by user OE3SUW. There was an error with his instructions
    however another user had a one line fix.
    The RTC ran fine under raspbian. and I could see there were many kernel modules in the rtc directory
    (/lib/modules/, however i don’t have an rtc directory using geexbox.
    I am assuming the rtc was never built for it.

    Thank you for your reply.


    Warped Rudi

    Since the only difference between the PCF2129A and PCF2127A appears to be the lack/presence of 512 bytes of battery-backed RAM, your device should work with the kernel we supply in r16294 “out of the box”. I.e. no need to compile anything. There are no modules in the rtc directory, because the one and only RTC driver we have configured (i.e. AbioRTC/PCF2129) is built directly into the kernel. It *should* auto-detect the device no matter which revision of the RPi hardware is used.

    Did you check, if your RTC is recognized ? I.e. run “hwclock” from a console (telnet, ssh or serial) ? Does /sys/class/rtc/rtc0 exist ?



    I had time this morning to run the “systemctl unmask hwclock-sync” and “hwclock’. I set the date and used hwclock to set the hardware time.
    now for the silly question, I was under the impression that I should see the rtc module when I typed lsmod.
    but I don’t see it listed. How can I be sure it is there?




    Sorry I missed your last post, yes it is there.
    rtc0 -> ../../devices/platform/bcm2708_i2c.1/i2c-1/1-0051/rtc/rtc0
    so I guess it is working.
    I was put off a bit by the seconds column being all zeros.
    “Wed Jul 31 04:45:01 2013 0.000000 seconds”
    as on the raspbian build I have it shows numbers in the seconds columns.
    “Wed Jul 31 04:39:20 2013 0.231923 seconds”

    Thank you for you help and explaining it to me, even after using Linux for 15 years,
    I can still learn new tricks. I am still having fun.

    I guess we can mark this as solved.


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.