I am trying to use SPI interface on Raspberry Pi 1 B (OS: Raspbian July 2017, kerenl 4.9.5). To do this, I am using wiringPi. I confirmed that wiringPi works via gpio readall
To load SPI:
gpio load spi
But this gives me an error:
gpio: Unable to load/unload modules as this Pi has the device tree enabled.
You need to run the raspi-config program (as root) and select the
modules (SPI or I2C) that you wish to load/unload there and reboot.
There is more information here:
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97314
Strangely, spidev
exists is under /dev
(Does it mean SPI is loaded?)
ls /dev/spi*
/dev/spidev0.0 /dev/spidev0.1
Anyway, to fix the problem, the link in the error message tells me to:
- Run
[sudo] raspi-config
and enable SPI: I did it and reboot Rpi- Did it, but didn't solve the problem.
- If (1) did not work, edit
/boot/config.txt
and adddtparam=spi=on
.- Did it, but didn't solve the problem.
And the official device tree document says one can disable device tree by editing /boot/config.txt
to have
device_tree=
But when it is done and reboot, only Rainbow splash appears and boot process never go further.
Can anyone give me an advice what I am missing?