2

I run raspi-config, enable SPI from menu and get message

The SPI interface is enabled

But in console I see

/usr/bin/raspi-config: 597: /usr/bin/raspi-config: dtparam: not found

Is SPI Enabled? How to verify SPI?

3 Answers 3

2

That appears to be a spurious raspi-config error message (caused by a bad link to a dynamic portion of device tree).

Reboot.

SPI is enabled if /dev/spidev0.0 and /dev/spidev0.1 exist.

0
0
  1. Run this command: sudo nano /boot/config.txt
  2. Add this at the end of the file: dtparam=spi=on
  3. Save file pressing: CTRL+X, Y and Enter
  4. Reboot your system: sudo reboot
1
  • Thank you for answer. In the config I see dtparam=spi=on is already enabled.
    – lavAzza
    Commented Jun 2, 2016 at 8:59
0

In addition to the above mentioned answers, you can also test if the port is really enabled and working properly as per rasp.'docs: , by connecting a wire between MOSI and MISO and running the following commands:

wget https://raw.githubusercontent.com/raspberrypi/linux/rpi-3.10.y/Documentation/spi/spidev_test.c
gcc -o spidev_test spidev_test.c
./spidev_test -D /dev/spidev0.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D

Basically it is just a loopback test.

Note:

This does not test CE0 and CE1

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.