bureau
Posts: 2
Joined: Tue Sep 27, 2011 5:04 pm

How to load SPI module without raspi-config

Sun Jul 15, 2018 7:46 pm

I have Raspberry-Pi 3 Model B with Raspbian on board

I would like to understand what have to be done to load SPI KERNEL module without raspi-config.

As I understood, after insmod I have to see new spi device in /dev/* folder. So... I see this list of modules:

Code: Select all

/lib/modules/4.14.52-v7+/kernel/drivers/spi/spi-bcm2835aux.ko
/lib/modules/4.14.52-v7+/kernel/drivers/spi/spi-bcm2835.ko
/lib/modules/4.14.52-v7+/kernel/drivers/spi/spi-gpio.ko
/lib/modules/4.14.52-v7+/kernel/drivers/spi/spi-bitbang.ko
/lib/modules/4.14.52-v7+/kernel/drivers/spi/spidev.ko
I tried to load spidev and spi-bcm2835, but lsmod is showed that modules are loaded, but with no result on /dev/spi*

Should I load modules with some parameters?

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

Re: How to load SPI module without raspi-config

Mon Jul 16, 2018 8:35 am

Use modprobe instead of insmod and check the log (dmesg) for any (error) messages.

But:
bureau wrote:
Sun Jul 15, 2018 7:46 pm
I would like to understand what have to be done to load SPI KERNEL module without raspi-config.
use device tree.
Add 'dtparam=spi' to /boot/config.txt


bureau
Posts: 2
Joined: Tue Sep 27, 2011 5:04 pm

Re: How to load SPI module without raspi-config

Mon Jul 16, 2018 7:39 pm

during command execution need to remove extensions of the module file name:

Code: Select all

[u]modprobe spi-bcm2835.ko[/u]  --> Wrong
[u]modprobe spi-bcm2835[/u]     --> Correct
Next step -- check if SPI modules was loaded: lsmod | grep spi*
When module will be loaded, you have to check if SPI devices is present in ls -l /dev/spi*
and use an example from [kernel_source]/tools/spi/spidev_test.c to test SPI communication

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

Who is online

Users browsing this forum: No registered users and 9 guests