I'm trying to do a spi loopback test with a raspberry pi 3 model B+ with kernel patched with RT_PREEMPT.
This is the loopback test being attempted: Link
To run the test you must specify a path such as /dev/spidev0.0. I have no such file in /dev:
pi@raspberrypi:~ $ ls /dev | grep spi
pi@raspberrypi:~ $
The kernel version:
pi@raspberrypi:~ $ uname -r
4.9.80-rt62-v7+
I think the settings in /boot/config.txt are what they are supposed to be and I've rebooted a few times since setting it this way:
pi@raspberrypi:/boot $ cat config.txt | grep spi
dtparam=spi=on
There seems to be all sorts of spi stuff in the loaded device tree:
pi@raspberrypi:~ $ dtc -I fs /proc/device-tree | grep 'spi'
<stdout>: Warning (unit_address_vs_reg): Node /soc has a reg or ranges property, but no unit name
<stdout>: Warning (unit_address_vs_reg): Node /soc/vchiq has a reg or ranges property, but no unit name
<stdout>: Warning (unit_address_vs_reg): Node /soc/gpiomem has a reg or ranges property, but no unit name
<stdout>: Warning (unit_address_vs_reg): Node /soc/local_intc has a reg or ranges property, but no unit name
<stdout>: Warning (unit_address_vs_reg): Node /soc/axiperf has a reg or ranges property, but no unit name
<stdout>: Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name
<stdout>: Warning (unit_address_vs_reg): Node /axi/vc_mem has a reg or ranges property, but no unit name
<stdout>: Warning (avoid_default_addr_size): Relying on default #address-cells value for /axi/vc_mem
<stdout>: Warning (avoid_default_addr_size): Relying on default #size-cells value for /axi/vc_mem
spi = "", "", "", "!status";
spi2 = "/soc/spi@7e2150c0";
spi0 = "/soc/spi@7e204000";
spidev1 = "/soc/spi@7e204000/spidev@1";
spi0_gpio35 = "/soc/gpio@7e200000/spi0_gpio35";
spi = "/soc/spi@7e204000";
spi0_pins = "/soc/gpio@7e200000/spi0_pins";
spi0_gpio7 = "/soc/gpio@7e200000/spi0_gpio7";
spi1 = "/soc/spi@7e215080";
spi1_gpio16 = "/soc/gpio@7e200000/spi1_gpio16";
spi2_gpio40 = "/soc/gpio@7e200000/spi2_gpio40";
spi0_cs_pins = "/soc/gpio@7e200000/spi0_cs_pins";
spidev0 = "/soc/spi@7e204000/spidev@0";
spi0_gpio35 {
spi0_pins {
spi0_gpio7 {
spi1_gpio16 {
spi2_gpio40 {
spi0_cs_pins {
spi@7e204000 {
compatible = "brcm,bcm2835-spi";
spidev@1 {
compatible = "spidev";
spi-max-frequency = <0x7735940>;
spidev@0 {
compatible = "spidev";
spi-max-frequency = <0x7735940>;
spi@7e215080 {
compatible = "brcm,bcm2835-aux-spi";
spi@7e2150c0 {
compatible = "brcm,bcm2835-aux-spi";
spi2 = "/soc/spi@7e2150c0";
spi0 = "/soc/spi@7e204000";
spi1 = "/soc/spi@7e215080";
Any hints?
--Edit after some good hints in the comments --
I think I forgot to copy the /lib/modules/4.9.80-rt62-v7+/* files from the host where I built the kernel to the target.
adam@hostWhereKernelWasCrossCompiled:~/rtBuild_4_9$ find -iregex '.*spidev.*'
./lib/modules/4.9.80-rt62-v7+/kernel/drivers/spi/spidev.ko
pi@raspberrypi:/lib $ find -iregex '.spidev.'
./modules/4.14.34-v7+/kernel/drivers/spi/spidev.ko
No modules for 4.9.80-rt62-v7+ (the active kernel) are installed on the target.
dmesgfor references to SPI – Jaromanda X May 06 '18 at 23:02lsmod | grep -i spi– Jaromanda X May 06 '18 at 23:12kernel patched with RT_PREEMPT... edit: never mind - found it – Jaromanda X May 06 '18 at 23:18spimodules in the standard kernel are:spi-bcm2835andspidev(these two are loaded when you change config.txt as you have done) - but then there's alsospi-bcm2835auxad714x-spiadxl34x-spipsxpad-spibmp280-spimmc_spiof_mmc_spispi-norarizona-spicxd2880-spi- not sure if you'd need any of those as well – Jaromanda X May 06 '18 at 23:32lib/modules/folder - yet you say you didn't "modularize"? – Jaromanda X May 06 '18 at 23:33