Tired to enable SPI1 of Xavier with L4T 32.1

Hi guys,
Recently I am really tired to enabling SPI1 of Xavier, I try 2 weeks but it does not work, NVIDIA has no official guide for Xavier, just a guide for TX2.
Fortunately, I search on our forum and get much help from you and finally make spidev1.0 occurred at /dev/ directory, unfortunately, when I use spidev_test, the pin does not work, I find I should change the pinmux file but when I change the .cfg file, another question occurred.

As a conclusion, to enable SPI1 I collect all my questions, can you help me with them?

  1. Should I rebuild the kernel? if so, which files should be modified and which files should be generated for full flash?
    for example, in the old guide for TX2, it says spidev.ko should be built and copy to TX2, but in Xavier, there is already have a spidev.ko about 20kb size, I rebuild the kernel find the new spidev.ko has 400kb, should I change it? And there is so many difference between TX2 and Xavier.
  2. Except for kernel issue, which file should I modify as well? The pinmux file, how to make a full flash with both pinmux file and kernel files, do you have an official guide?

I really wish you can answer my question in detail, thanks very much!

Hi Gaosiy,

  1. The module already had the spi driver there. I don’t think you need to rebuild it. Also, the difference of file size is due to the optimization of compilation, so the pre-built file from jetpack is smaller.

  2. The full flash command is already in L4T documentation. You could download it from download cetner.

“sudo ./flash jetson-xavier mmcblk0p1”

Also, what is the error you have so you knew the spi driver is not working?

Hi Wayne,
thanks for your help.

  1. If spidev.ko is not necessary, how about the dtb file, to realize spidev show in /dev/ when system boot, I change the dtb file with dtc at the host directory nvidia/nvidia_sdk/JetPack_4.2_Linux_P2888/Linux_for_Tegra/kernel/dtb/tegra194-p2888-0001-p2822-0000.dtb and use the flash command as you say
    “sudo ./flash jetson-xavier mmcblk0p1” to flash xavier, and, I have the spidev1.0, is this device number 1.0 right for SPI1?
    2.if spidev1.0 is the right number of SPI1, then I change the pinmux use the method as I show in this topic
    https://devtalk.nvidia.com/default/topic/1056359/xavier-spi1-use-spidev_test-c-issue/
    I try to modify .cfg file, and use “sudo ./flash jetson-xavier mmcblk0p1” to flash xavier, but when I check the value of what I change, it seems not to be achieved, so I use devmem2 command to change the value manually, as
Value at address 0x243D040 (0x7f88573040): 0x400
Value at address 0x243D020 (0x7fb70ec020): 0x450
Value at address 0x243D058 (0x7f9047a058): 0x400
Value at address 0x243D010 (0x7f7bfb8010): 0x400
Value at address 0x243D050 (0x7f78fd6050): 0x400

the result is when I test the spidev_test.c program, it does not work, the received message is different from sending message

xavier@xavier-desktop:~/Documents/tools/spi$ sudo ./spidev_test -v
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D  | ......@....�..................�.
RX | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................................

and I dont know what should I do next.

Find the problem, spidev1.0 is not SPI1, spidev0.0 is SPI1
is wired

Hi Gaosiy !
I can’t boot my xavier,after i replace Linux_for_Tegra/kernel/dtb/tegra194-p2888-0001-p2822-0000.dtb and flash my xavier.