1

Possibly related question: spi stopped working after upgrade

Background

I have had SPI working on my RPi 2 model B. I stopped using it for a couple of months, and now that I'm trying to use it again (with the exact same code) it is no longer working.

I can't think what might have caused it. I'm pretty sure I did an update during that time, but I can't see the commands anywhere in the command-line history, so I could have dreamed that. The contents of /proc/version is:

Linux version 4.1.15-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #830 SMP Tue Dec 15 17:02:45 GMT 2015

Symptoms

A logic analyser is attached to the SPI pins. When I run either of these two commands:

echo -ne "\x01\x02\x03" > /dev/spidev0.0
echo -ne "\x01\x02\x03" > /dev/spidev0.1

nothing is seen on the analyser.

/dev/spidev0.0 and /dev/spidev0.1 both exist. dtparam=spi=on is set. When I run my previously working code, I get no error messages, and the code seems to be able to set things like the clock speed, and read it back correctly.

Everything seems in order, except for the lack of a signal.

Question

What should I look for to debug this?

Update

I have upgraded. Linux version is now:

Linux version 4.4.38-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #938 SMP Thu Dec 15 15:22:21 GMT 2016

/boot/config.txt still contains dtparam=spi=on

And still nothing is seen on the logic analyser when I try to echo to /dev/spidev0.0 or /dev/spidev0.1.

4
  • Is this your own kernel build?
    – joan
    Feb 14, 2017 at 22:37
  • @joan - No. I've only ever followed instructions on web sites. I'm not up to advanced things like building my own kernel. Feb 14, 2017 at 22:48
  • 1
    You don't tell us which - I assume Raspbian. Your kernel is quite old, update your system THEN tell us HOW you enabled SPI and what devices you are trying to communicate with.
    – Milliways
    Feb 14, 2017 at 23:00
  • @Milliways - OK, I've upgraded, but sadly it's still not working. Feb 15, 2017 at 22:02

1 Answer 1

0

Turns out that somehow the connector plugged into the GPIO header had become unplugged and plugged back in 1 pin off, so it wasn't getting 3.3v and GND. I suppose it must have been me that did it, though I can't remember taking it all apart to do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.