How to make "sudo modprobe spidev" persist after reboot?

I am using the SPI devices in my program, and i already set everything up for the jetson io. Problem is the SPI device dont show up after restart. I have to always run :

sudo modprobe spidev

after every restart so that the spi dev will be detected.

After a restart:

jetson@jetson-desktop:~$ ls /dev/i2c* /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory
 /dev/i2c-0   /dev/i2c-2   /dev/i2c-4   /dev/i2c-6
 /dev/i2c-1   /dev/i2c-3   /dev/i2c-5
jetson@jetson-desktop:~$ sudo modprobe spidev
[sudo] password for jetson: 
jetson@jetson-desktop:~$ ls /dev/i2c* /dev/spi*
/dev/i2c-0  /dev/i2c-3  /dev/i2c-6      /dev/spidev1.0
/dev/i2c-1  /dev/i2c-4  /dev/spidev0.0  /dev/spidev1.1
/dev/i2c-2  /dev/i2c-5  /dev/spidev0.1
jetson@jetson-desktop:~$

How do i make it so that the spi dev persist after restarting?

I don’t know if this will work, but have you ever run this?
sudo depmod -a

If that doesn’t work, then maybe you can create file:
/etc/modules-load.d/spidev.conf

For content of that file, just this one line:
spidev
(I don’t know if that is enough, it might have no effect; don’t bother until done testing depmod)

This one is the one that worked for me. Thanks so much !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.