0

I have already seen the questions: Does SPI port work on Raspberry B+ and SPI module on Raspberry Pi 2, but they don't answer my question.

I can't seem to get the SPI port working on my Raspberry Pi 2. Using a logic analyser connected to the pins, I can't get any signals from it, using spincl or by echo -ne "\x01\x02\x03" > /dev/spidev0.1

When I try to enable it with raspi-config, I get the following error:

modprobe: ERROR: could not insert 'spi_bcm2708': No such device
  • My /etc/modprobe.d/raspi-blacklist.conf is empty
  • /boot/config.txt contains dtparam=spi=on and dtoverlay=spi-bcm2835
  • /proc/cpuinfo contains Hardware : BCM2709
  • lsmod contains spi_bcm2835

Here is the output of several commands:

ls /dev/spidev*
/dev/spidev0.0  /dev/spidev0.1

uname -a
Linux raspberrypi 4.1.15-v7+ #830 SMP Tue Dec 15 17:02:45 GMT 2015 armv7l GNU/Linux

I'm a little confused about the fact that the hardware is listed as 2709, but it seems to be giving an error about 2708. Is this the reason the SPI isnt working?

2 Answers 2

2

SPI now uses the spi_bcm2853 module. spi_bcm2708 is deprecated.

You should see SPI activity with echo -ne "\x01\x02\x03" > /dev/spidev0.1

If you don't you are monitoring the wrong GPIO.

My piscope may help if the SPI bus speed is circa 100 kbps.

1

I got it working on a Pi 3 after some time, I already thought I had an error in cabling or soldering. It would load the spi_bcm2853 by default, but that was not working. I added dtoverlay=spi-bcm2708 to /boot/config.txt and after a reboot the cards were recognized. The used device is /dev/spidev0.0 tho, not 0.1. All cables go to pins 17 up to 24 (18 not connected):

spi cabling

The result from the Read.py:

Read.py

1
  • good answere, i want to add that you can also change the pins when overlaying, just in case you hardwired something or haven't enough space on gpio: dtoverlay=lirc-rpi,gpio_out_pin=17,gpio_in_pin=13 as an example
    – clockw0rk
    Commented Oct 27, 2021 at 14:45

Your Answer

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

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