Page 1 of 1

Failure: RTC with RV3029

Posted: Sun Dec 23, 2012 4:44 pm
by Raimund
I have installed a RV-3029-C2 Real Time Clock (RTC) module for the Raspberry Pi (Model B Revision 2.0 512 MB).

Code: Select all

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: -- -- -- -- -- -- 56 -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Code: Select all

sudo modprobe rtc-rv3029c2
sudo bash
echo rv3029c2 0x56 > /sys/bus/i2c/devices/i2c-1/new_device
exit
When i put follow command:

Code: Select all

sudo hwclock -r
i become follow error:

Code: Select all

hwclock: select() to /dev/rtc0 to wait for clock tick timed out: No such file or directory
why? please help me. :roll:

Re: Failure: RTC with RV3029

Posted: Sun Dec 23, 2012 5:45 pm
by aaa801
didnt the v2 have some swaped gpio pins, you sure its hooked up correctly?

Re: Failure: RTC with RV3029

Posted: Sun Dec 23, 2012 7:01 pm
by Raimund
aaa801 wrote:didnt the v2 have some swaped gpio pins, you sure its hooked up correctly?
that is correct. the modul was found on ic2-bus 1 on address 0x56 (before i bind the device to the driver).

Code: Select all

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: -- -- -- -- -- -- 56 -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
when i used i2cset / i2cget - i can read the secound register of the chip and i mean it works perfectly.

Code: Select all

sudo i2cset -y 1 0x56 0x08
sudo i2cget -y 1 0x56
0x27
sudo i2cget -y 1 0x56
0x29
sudo i2cget -y 1 0x56
0x30
sudo i2cget -y 1 0x56
0x31
when i bind the device on the driver

Code: Select all

sudo bash
echo rv3029c2 0x56 > /sys/bus/i2c/devices/i2c-1/new_device
exit
i see follow ("UU". Probing was skipped, because this address is currently in use by a driver.)

Code: Select all

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: -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
and i ckecked also

Code: Select all

cat /proc/devices | grep rtc
254 rtc

ls -l /dev | grep rtc
crw------- 1 root root    254,   0 Dez 17 03:22 rtc0
...but i become follow error on next command.

Code: Select all

sudo hwclock -r --debug
hwclock from util-linux 2.20.1
Using /dev interface to clock.
Last drift adjustment done at 1355708249 seconds after 1969
Last calibration done at 1355708249 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
hwclock: select() to /dev/rtc0 to wait for clock tick timed out: Datei oder Verzeichnis nicht gefunden
...synchronization failed

Re: Failure: RTC with RV3029

Posted: Tue Jul 08, 2014 11:29 am
by BjoernS
The problem lies in the rv2029c2 driver.
As the rv3029c2 doesn´t support Interrupts, the flag "uie_unsupported" has to be set in the source code. After that you have to recompile the module. (If you have your kernel headers at hand, otherwise you have to compile the whole kernel.)

The reason for this is that hwclock normally waits for an Interrupt to get the time better than 1s. When the flag is not set the wait on the Interrupt times out an you get the error message, if the flag is set, the ioctl to the device returns an error code and hwclock tries to reading the time very often to recognize the beginning of a new second.
There is even code in the Kernel for this which is also activated by this flag (and an configuration Option if I remember correctly.).