kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: arigead@gmail.com (John Whitmore)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Problem with SPI RTC DS3234 on RaspberryPi 2
Date: Sat, 11 Apr 2015 14:25:56 +0100	[thread overview]
Message-ID: <20150411132555.GA6833@griso> (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

             reply	other threads:[~2015-04-11 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-11 13:25 John Whitmore [this message]
2015-04-11 16:50 ` Problem with SPI RTC DS3234 on RaspberryPi 2 Henry Hallam
2015-04-12  9:06   ` John Whitmore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150411132555.GA6833@griso \
    --to=arigead@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).