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:

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:

  1. Run [sudo] raspi-config and enable SPI: I did it and reboot Rpi
    • Did it, but didn't solve the problem.
  2. If (1) did not work, edit /boot/config.txt and add dtparam=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


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?

1 Answer 1


I doubt you can disable device tree anymore, that was intended to be a temporary directive to smooth the introduction of device tree.

Just add the device tree SPI entry. Do not use gpio load spi. That is deprecated.

As long as there /dev/spidev* entries you can use SPI.

To summarise

  1. remove device_tree= from /boot/config.txt
  2. add dtparam=spi=on to /boot/config.txt
  3. do not use gpio load spi
  • Ok, then seems I did something wrong elsewhere. Thank you.
    – Jeon
    Commented Aug 5, 2017 at 6:28

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.