LOOPBACK - SPI - Jetson AGX Xavier

Hi,
We tried to do loopback test in Jetson AGX Xavier by shorting the MOSI and MISO pins(19,21). After done the initial setup we ran the code spidev_test.c in the linux source code linux/tools/spi/spidev_test.c.

It also worked . But why even removed the wire, the loopback is working .
If the wire is not shorted means, it no need to work right?

Could you please reply on what is the cause.

Thanks in advance

Hi,
For running loopback test, please refer to the steps in
Jetson/L4T/peripheral/ - eLinux.org

Thanks for the reply DaneLLL.
I’ve referred the link you shared which is for jetson nano…Jetson nano’s SPI pins are GPIO based (MOSI - GPIO 19 and MISO - GPIO 21) which requires to remove the “GPIO usage of SPI pins”
But in Jetson AGX Xavier , the SPI pins are not GPIO based. They are fixed as MOSI and MISO. So I didn’t follow the step “Removing usage of GPIO pins”

Is my assumption is correct?

Hi swedhar10,

Are you using the devkit or custom board for AGX Xavier?
What’s your Jetpack version in use?

It should not work if you disconnect the shorting for MISO and MOSI.
Could you share the detailed steps how you verify loopback test?

Hi Kevin,
Thanks for the response.

Yeah I am using devkit for AGX Xavier
Jetpack version - 5.1.1-b56

Sure,

  1. Enabled the SPI pins using the python script
  2. Loaded the kernel: sudo modprobe spidev
  3. Shorted MOSI and MISO pins (19&21)
  4. Cross compiled & Ran the test program : linux/tools/spi/spidev_test.c at master · torvalds/linux · GitHub
  5. Followed this website for cross compiling : Jetson/TX2 SPI - eLinux.org
  6. Command for loopback : ./spidev_test -D /dev/spidev0.1 -v -p “helloWorld123456789abcdef”
    Attached the screenshot also. This loopback test is working after removing the wires

Thanks in advance!

Please refer to the following steps to run the loopback test.

Step 1. 
$ wget https://raw.githubusercontent.com/torvalds/linux/v4.9/tools/spi/spidev_test.c
$ gcc -o spidev_test spidev_test.c
$ sudo modprobe spidev

Step 2.
(short PIN19/PIN21)
$ sudo ./spidev_test -D /dev/spidev0.0 -v -p "HelloWorld123456789abcdef"

Step3.
(disconnect PIN19/PIN21)
$ sudo ./spidev_test -D /dev/spidev0.0 -v -p "HelloWorld123456789abcdef"

Do you have scope to measure if there’s signal on PIN19 and PIN21 in Step 3?

Do you have other AGX Xavier devkit with the same behavior?

Thanks for the response Kevin.
I will try it out and get back to you.

Regards
Swedha R

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