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
.
SPI
and what devices you are trying to communicate with.