# Tired to enable SPI1 of Xavier with L4T 32.1

**URL:** <https://forums.developer.nvidia.com/t/tired-to-enable-spi1-of-xavier-with-l4t-32-1/77295>\
**Category:** Jetson AGX Xavier\
**Created:** [July 1, 2019, 3:20am UTC](https://forums.developer.nvidia.com/t/tired-to-enable-spi1-of-xavier-with-l4t-32-1/77295 "2019-07-01T03:20:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaosiy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/gaosiy/32/13016_2.png) [@Gaosiy](https://forums.developer.nvidia.com/u/Gaosiy)\
**Post date:** [July 1, 2019, 3:20am UTC](https://forums.developer.nvidia.com/t/tired-to-enable-spi1-of-xavier-with-l4t-32-1/77295/1 "2019-07-01T03:20:16Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![WayneWWW](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/waynewww/32/14043_2.png) [@WayneWWW](https://forums.developer.nvidia.com/u/WayneWWW)\
**Post date:** [July 1, 2019, 4:19am UTC](https://forums.developer.nvidia.com/t/tired-to-enable-spi1-of-xavier-with-l4t-32-1/77295/2 "2019-07-01T04:19:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Gaosiy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/gaosiy/32/13016_2.png) [@Gaosiy](https://forums.developer.nvidia.com/u/Gaosiy)\
**Post date:** [July 1, 2019, 7:18am UTC](https://forums.developer.nvidia.com/t/tired-to-enable-spi1-of-xavier-with-l4t-32-1/77295/3 "2019-07-01T07:18:16Z")

</div>

> [@WayneWWW](#):
>
> 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  
[Xavier SPI1 use spidev\_test.c issue - Jetson AGX Xavier - NVIDIA Developer Forums](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

```auto
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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Gaosiy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/gaosiy/32/13016_2.png) [@Gaosiy](https://forums.developer.nvidia.com/u/Gaosiy)\
**Post date:** [July 21, 2019, 1:08am UTC](https://forums.developer.nvidia.com/t/tired-to-enable-spi1-of-xavier-with-l4t-32-1/77295/4 "2019-07-21T01:08:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![3620254461](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@3620254461](https://forums.developer.nvidia.com/u/3620254461)\
**Post date:** [January 12, 2020, 8:57am UTC](https://forums.developer.nvidia.com/t/tired-to-enable-spi1-of-xavier-with-l4t-32-1/77295/5 "2020-01-12T08:57:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [July 16, 2021, 9:15am UTC](https://forums.developer.nvidia.com/t/tired-to-enable-spi1-of-xavier-with-l4t-32-1/77295/6 "2021-07-16T09:15:26Z")

</div>

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