Jetson Nano trouble using SPI

Hi :) I have a problem configuring and using SPI on the Jetson Nano development board. I hope that please anyone here can help me out solving this problem. Here’s what I’ve done:

  • As always, I’ve downloaded the latest version of the JetPack 4.6.1 (with this link).

  • As it’s written in many of the topics here, I’ve used sudo /opt/nvidia/jetson-io/jetson-io.py tool, to enable SPI on these pins 19-MOSI, 21-MISO, 23-SCK and 24-CS. (I’ve also seen that in older versions of the JP this tool had some problems before JP 4.3)

  • Once I’ve enabled it, I rebooted and used sudo modprobe spidev to enable it correctly. I’ve tested it using ls /dev/ | grep spi and it listed spidev0.0, spidev0.1, spidev1.0 and spidev1.1.

  • I’ve also tested it using sudo /opt/nvidia/jetson-io/config-by-function.py -l enabled and it showed this:


The following functions are enabled on the 40-pin header:

1. spi1

After these verifications I thought that I was able to use SPI correctly, and I was trying to do the loopback test using this compiled executable:

https://forums.developer.nvidia.com/t/jetson-nano-trouble-using-spi/195510/13

I’ve used a wire to bridge 19-21 pins (MISO to MOSI), but I wasn’t able to make it work using sudo ./spidev_test -D/dev/spidev0.0 -n1 -s10000000 -g10 -p1 -zz.


using device: /dev/spidev0.0

setting spi mode for read,write

setting spi bpw

setting max speed for rd/wr

spi mode: 0

bits per word: 8 bytes per word: 1

max speed: 10000000 Hz (10000 KHz)

no. runs: 1

Using seed:0x5f9f64e2

loop count = 0

Using even no. pattern …

transfer bytes [10]

0000: 02 04 06 08 0A 0C 0E 10 12 14

transfer: Return actual transfer length: 10

receive bytes [10]

0000: 00 00 00 00 00 00 00 00 00 00

mismatch index 0

^^^ 00 00 00 00 00 00 00 00 00 00 00 /dev/spidev0.0: TEST FAILED !!! (status:-1)

If any of you guys can help me it would be highly appreciated, I’ve tried the same process with 2 Jetsons, initially I thought that it was a problem from the pins (maybe a malfunctioning) but I’m not sure how I can proceed from now, or how I can make it work.

Hi m6d8,

The latest Jetpack release for Jetson Nano should be Jetpack 4.6.5 (R32.7.5)

To verify SPI loopback test on Jetson Nano, please refer to the following thread for the detailed steps.
Jetson Nano SPI Bus Not Working - #10 by KevinFFF

Thank you so much, it took me a bit to perform the tests but I was able to use the SPI Bus without any issues

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