Skip to contentSkip to conversation

Problem with SPI RTC DS3234 on RaspberryPi 2

DISCUSSION John Whitmore 2 participants 3 messages Apr 11, 2015 – Apr 12, 2015

lore
Share & tools
lore
#0 lore raw

I've had a problem for weeks with a development board I have used in the past on the Original RaspberryPi. The expansion board has two spi devices connected, a CAN Bus controller (MCP2515) and a Real Time Clock chip DS3234. On the old RPi everything works great with two devices in:

/sys/bus/spi/devices

pi at can-rtc:~$ cat /sys/bus/spi/devices/spi0.0/modalias spi:mcp2515
pi at can-rtc:~$ cat /sys/bus/spi/devices/spi0.1/modalias spi:ds3234

This output is exactly the same on the RPi-2 but the RPi-2 finds the RTC time invalid:

sudo hwclock -r
hwclock: The Hardware Clock registers contain values that are either invalid (e.g. 50th day of month) or beyond.

The CAN Bus Controller does work on both versions of the RPi, it's just the RTC that has a problem.

If connect up the Ethernet interface to get the correct time, from the network, I can write it to the device with "hwclock -w". Then remove the expansion board and power it up on the original RPi and it's got the correct time which is sets as the system time.

If I now remove it from the original RPi and connect to RPi-2 it can't read a valid time. but it all seems the same.

    cat /sys/bus/spi/devices/spi0.1/rtc/rtc0/name 
    ds3234

In both cases I've compiled the ds3234 and mcp2515 drivers into the kernel. In the original RPi the board file is edited to add the two devices but in the RPi-2 a hardware overlay file is added. Like I say everything appears to be exactly the same in both cases. Just the result is totally different.

Can anybody explain why there should be a difference? The GPIO headers in both versions of the RPi are the same for the first set of pins.

Original RPi kenel - 3.15.5
RPi-2 kernel - 3.18.8

#1 lore raw
Quoted 2 lines · John Whitmore

Original RPi kenel - 3.15.5
RPi-2 kernel - 3.18.8

Maybe try the new kernel version on the old board, to eliminate that variable?

Henry

#2 lore raw
Quoted 7 lines · Henry Hallam
Quoted 2 lines · John Whitmore

Original RPi kenel - 3.15.5
RPi-2 kernel - 3.18.8

Maybe try the new kernel version on the old board, to eliminate that variable?

Henry

I've never been able to boot the 3.18.8 kernel in the RPi (original) it hangs in the boot. It don't seem to be as simple as taking the 3.15.5 config file and "make oldconfig". Whilst that does build a kernel which attempts to boot it hangs during the boot process.

Possibly due to the change to device trees. Can't seem to find anything on 3.18.8 for original RPi