help compiling RTC module [rtc-pcf2127a]

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Re: help compiling RTC module [rtc-pcf2127a]

Postby moonman » Sat Sep 21, 2013 4:41 am

It's in the repo now
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: help compiling RTC module [rtc-pcf2127a]

Postby nigelh » Sun Sep 22, 2013 1:19 pm

Very many thanks, moonman, for the explanation and commiting the changes.
I'll give linux-raspberry-latest a try when it appears !
Appreciate your help,
regards
Nigel
nigelh
 
Posts: 8
Joined: Tue Aug 13, 2013 8:34 pm

Re: help compiling RTC module [rtc-pcf2127a]

Postby nigelh » Tue Oct 15, 2013 8:48 am

Well, it's nearly a month later and although I've made a little progress towards getting my RasClock working on an archlinux arm raspberry pi, I'm still hitting problems!
Using the linux-raspberrypi-latest package I now have the module loaded ok. (Thanks to moonman)
lsmod shows :-
$this->bbcode_second_pass_code('', '
rtc_pcf2127 2642 0
i2c_bcm2708 3949 0
')
amongst many other modules.

When I then try to make a new i2c device, using :-
$this->bbcode_second_pass_code('', '
echo pcf2127a 0x51 > /sys/class/i2c-dev/i2c-1/device/new_device
')

I see this in dmesg:-
$this->bbcode_second_pass_code('', '
Oct 15 11:27:20 raspberrypi kernel: i2c i2c-1: new_device: Instantiated device pcf2127a at 0x51
')

but there is still no sign of /dev/rtc0 and entering hwclock I am still getting:-

$this->bbcode_second_pass_code('', '
# hwclock
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
')
Reading another blog ( http://blog.remibergsma.com/2013/05/08/ ... pberry-pi/ )
about half way down the page is this:-
" It’s now time to boot the new kernel. When you reboot, the RasClock will be available as /dev/rtc0.

dmesg

The kernel ring buffer should list something like this:"
$this->bbcode_second_pass_code('', '
[ 32.737903] rtc-pcf2127a 1-0051: chip found
[ 32.739712] rtc-pcf2127a 1-0051: rtc core: registered rtc-pcf2127a as rtc0
[ 32.739775] i2c i2c-1: new_device: Instantiated device pcf2127a at 0x51
')

I'm obviously still missing something because I don't see the first two lines about the chip being found and then
"rtc core registered rtc-pcf2127a as rtc0"

Does anyone have any clues as to what that is telling me, please ??
Any thoughts/help would be greatly appreciated!
Cheers
Nigel
nigelh
 
Posts: 8
Joined: Tue Aug 13, 2013 8:34 pm

Re: help compiling RTC module [rtc-pcf2127a]

Postby moonman » Tue Oct 15, 2013 9:20 am

Isn't the driver in 3.11 called pcf2127 and not pcf2127a. Don't know if they are compatible, but try using that name instead.
They seem to be written by 2 different people/companies:
The out of tree one (pcf2127a):
$this->bbcode_second_pass_code('', '/*
* Driver the the NXP/Philips PCF2127A RTC (only I2C)
*
* Copyright (c) 2011 ECKELMANN AG.
*
* Authors: Matthias Wolf <m.w...@eckelmann.de>
* Torsten Mehnert <t.me...@eckelmann.de>')

The in-tree one (pcf2127):
$this->bbcode_second_pass_code('', '/*
* An I2C driver for the NXP PCF2127 RTC
* Copyright 2013 Til-Technologies
*
* Author: Renaud Cerrato <r.cerrato@til-technologies.fr>')

Either way 2127 driver should support all variations of the chip.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: help compiling RTC module [rtc-pcf2127a]

Postby nigelh » Tue Oct 15, 2013 5:00 pm

Brilliant, moonman - thanks VERY much for pointing that out - I've just tried it and:-

$this->bbcode_second_pass_code('', '
root@raspberrypi nigel]# echo pcf2127 0x51 > /sys/class/i2c-dev/i2c-1/device/new_device
[root@raspberrypi nigel]# hwclock -r
Tue Oct 15 19:47:37 2013 -0.548562 seconds
')

also:-

$this->bbcode_second_pass_code('', '
journalctl -f

Oct 15 19:47:00 raspberrypi kernel: rtc-pcf2127 1-0051: chip found, driver version 0.0.1
Oct 15 19:47:00 raspberrypi kernel: rtc-pcf2127 1-0051: rtc core: registered rtc-pcf2127 as rtc0
Oct 15 19:47:00 raspberrypi kernel: i2c i2c-1: new_device: Instantiated device pcf2127 at 0x51
')

That was my error - I really should pay attention to ALL the detail!
:oops:
Thanks again,
regards,
Nigel
nigelh
 
Posts: 8
Joined: Tue Aug 13, 2013 8:34 pm

Re: help compiling RTC module [rtc-pcf2127a]

Postby ElScotto » Fri Nov 29, 2013 11:20 pm

For those who want to automate instantiating the RTC device at boot time, you can use the systemd-tmpfiles facility.
To do this, create a file called /etc/tmpfiles.d/rtc-pcf2127.conf and add the following text:

$this->bbcode_second_pass_code('', '
# Bind the device to the driver
w /sys/class/i2c-dev/i2c-1/device/new_device - - - - pcf2127 0x51
')

Presuming that you've already got the driver module itself being loaded via a conf file in /etc/modules-load.d, this will trigger the device creation at boot time.
ElScotto
 
Posts: 1
Joined: Thu Apr 11, 2013 2:42 am

Re: help compiling RTC module [rtc-pcf2127a]

Postby sinuz » Wed Dec 11, 2013 10:55 am

Is it possible to load the 2127 (not a) module in the current stable kernel without compiling the whole thing?
sinuz
 
Posts: 2
Joined: Wed Dec 11, 2013 10:28 am

Re: help compiling RTC module [rtc-pcf2127a]

Postby moonman » Thu Dec 12, 2013 12:27 am

Is it a part of 3.10? if it is it can be enabled. I'll take a look when i get home
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: help compiling RTC module [rtc-pcf2127a]

Postby moonman » Thu Dec 12, 2013 6:36 am

It is not in the 3.10 tree.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: help compiling RTC module [rtc-pcf2127a]

Postby moonman » Thu Dec 12, 2013 10:37 am

The driver is now in the linux-raspberrypi package starting with 3.10.23-2 version
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

PreviousNext

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 19 guests