bass0324
Posts: 19
Joined: Fri Aug 31, 2012 2:32 pm

spidev in Raspbian help

Fri Nov 02, 2012 1:13 pm

I am trying to use the spi port on the Raspbian OS for the Pi but I am unable to see spidev in /dev/. Is there anything I can do to get this to show up? I tried a modprobe spidev, also rpi-update and neither worked. I know everything I have found online about the spi bus was using the Debian weezy version which I am assuming is different, but i figure it shouldn't matter. Any help would be greatly appreciated.

User avatar
[email protected]
Posts: 1983
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: spidev in Raspbian help

Fri Nov 02, 2012 2:41 pm

bass0324 wrote:I am trying to use the spi port on the Raspbian OS for the Pi but I am unable to see spidev in /dev/. Is there anything I can do to get this to show up? I tried a modprobe spidev, also rpi-update and neither worked. I know everything I have found online about the spi bus was using the Debian weezy version which I am assuming is different, but i figure it shouldn't matter. Any help would be greatly appreciated.
wheezy is a bit long in the tooth now - and I don't know what state the kernel is in for Wheezy. I'd strongly recommend upgrading (or starting from scratch) with Raspbian. It's still wheezy, but compiled to match the Pi's ARM architecture and it kept up to date kernel wise, etc.

Does doing a sudo modprobe spidev really do nothing - not even an error message? If you get nothing printed, then it suggests it worked OK. Try lsmod and ls -l /dev/spi*

I've been using the SPI on the Pi without any issues so-far, so it does work!

-Gordon
--
Gordons projects: https://projects.drogon.net/

bass0324
Posts: 19
Joined: Fri Aug 31, 2012 2:32 pm

Re: spidev in Raspbian help

Fri Nov 02, 2012 2:53 pm

When I do "sudo modprobe spidev" it returns nothing so I assume it goes through just fine. I have also tried lsmod in /dev/ and also ls -l /dev/spi* and neither of them could find anything spi related in the /dev folder. I am not seeing I2C or SPI at all. Also, I just redid my Raspbian image based off the most recent one released by eben on the 28th. So I am not sure why this is happening at all since the newest kernel should have support for it built in.

User avatar
[email protected]
Posts: 1983
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: spidev in Raspbian help

Fri Nov 02, 2012 3:01 pm

bass0324 wrote:When I do "sudo modprobe spidev" it returns nothing so I assume it goes through just fine. I have also tried lsmod in /dev/ and also ls -l /dev/spi* and neither of them could find anything spi related in the /dev folder. I am not seeing I2C or SPI at all. Also, I just redid my Raspbian image based off the most recent one released by eben on the 28th. So I am not sure why this is happening at all since the newest kernel should have support for it built in.
It certianly should do. Very odd!

Code: Select all

gordon @ pi2: ls -l /dev/spi*
ls: cannot access /dev/spi*: No such file or directory
gordon @ pi2: gpio load spi
gordon @ pi2: ls -l /dev/spi*
crw------- 1 gordon gordon 153, 0 Nov  2 14:59 /dev/spidev0.0
crw------- 1 gordon gordon 153, 1 Nov  2 14:59 /dev/spidev0.1
gordon @ pi2: lsmod | grep spi
spidev                  5136  0 
spi_bcm2708             4401  0 
I put spi loading into the gpio program to make it easy for me but now remembering that you also need to modprobe spi_bcm2708 - so maybe that's what's missing?

Actually, re-reading my own notes you should modprobe spi_bcm2708 and it'll bring in spidev too.

-Gordon
--
Gordons projects: https://projects.drogon.net/

bass0324
Posts: 19
Joined: Fri Aug 31, 2012 2:32 pm

Re: spidev in Raspbian help

Fri Nov 02, 2012 3:05 pm

"sudo modprobe spi_bcm2708" worked for me, thanks so much!!!!

dotgreg
Posts: 1
Joined: Thu Jul 31, 2014 5:46 am

Re: spidev in Raspbian help

Thu Jul 31, 2014 5:50 am

To help, I solved this issue with Rpi-config,
-> do "sudo raspi-config"
-> Go to "Advanced Options"
-> Go to "A5 SPI" option
-> Click on yes when asked if you wanted to load the SPI kernel by default

-> reboot and you are done

;-)

DirkS
Posts: 9234
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: spidev in Raspbian help

Thu Jul 31, 2014 4:54 pm

dotgreg wrote:To help, I solved this issue with Rpi-config,
Sorry, no record for digging up long deceased topics ;)

BTW When the above post was written that option was not yet available in raspi-config...

tedy58
Posts: 1
Joined: Wed Oct 10, 2018 9:14 pm

Re: spidev in Raspbian help

Wed Oct 10, 2018 9:35 pm

by dotgreg » Thu Jul 31, 2014 8:50 am

To help, I solved this issue with Rpi-config,
-> do "sudo raspi-config"
-> Go to "Advanced Options"
-> Go to "A5 SPI" option
-> Click on yes when asked if you wanted to load the SPI kernel by default

-> reboot and you are done
Thanks @dotgreg for that usefull hint!
After I upgrade my RPi 3B+ then rpi-config have little different options:
$sudo raspi-config
-> Go to 5 Interfaceing Options -> P4 SPI Enable/Disable automatic loading
-> Click on <yes> when asked if you like to enable the SPI interface
-> reboot and you are done

Return to “Interfacing (DSI, CSI, I2C, etc.)”