Hi, I’m using devkit board Xavier NX to test its spi pin using R35.3.1. And after I enabled spi1 and spi3, it is ok in spi1 using spidev_test tool as follows (connect pin19 and pin21):
nvidia@nvidia:~/test$ sudo ./spidev_test -D /dev/spidev0.0 -v -p hello
spi mode: 0x0
bits per word: 8
max speed: 50000000 Hz (50000 kHz)
TX | 68 65 6C 6C 6F __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |hello|
RX | 68 65 6C 6C 6F __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |hello|
But when I connect spi3 MISO and MOSI (pin22 and pin37), it can not get the right data as below:
nvidia@nvidia:~/test$ sudo ./spidev_test -D /dev/spidev2.0 -v -p hello
spi mode: 0x0
bits per word: 8
max speed: 50000000 Hz (50000 kHz)
TX | 68 65 6C 6C 6F __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ |hello|
RX | 20 20 24 24 27 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ | $$'|
Do you know what causes it?
Thanks
Hi 854053437,
Have you used Jetson-IO to enable both spi1(19,21,23,24,26)
and spi3(13,16,18,22,37)
?
Please share the result of the following command on your board.
$ sudo busybox devmem 0x0243d048 //SPI3_SCK
$ sudo busybox devmem 0x0243d060 //SPI3_MOSI
$ sudo busybox devmem 0x0243d008 //SPI3_MISO
$ sudo busybox devmem 0x0243d018 //SPI3_CS0
$ sudo busybox devmem 0x0243d028 //SPI3_CS1
KevinFFF:
Have you used Jetson-IO to enable both spi1(19,21,23,24,26)
and spi3(13,16,18,22,37)
?
YES, I’ve done that and spi1 works fine.
here is the result
nvidia@nvidia:~/test$ sudo busybox devmem 0x0243d048
0x00001444
nvidia@nvidia:~/test$ sudo busybox devmem 0x0243d060
0x00001444
nvidia@nvidia:~/test$ sudo busybox devmem 0x0243d008
0x00001444
nvidia@nvidia:~/test$ sudo busybox devmem 0x0243d018
0x00001448
nvidia@nvidia:~/test$
nvidia@nvidia:~/test$ sudo busybox devmem 0x0243d028
0x00001448
nvidia@nvidia:~/test$
You pinmux seems correct for SPI3.
I could not reproduce your issue on Xavier NX devkit with R35.3.1.
nvidia@nvidia-desktop:~$ sudo ./spidev_test -D /dev/spidev2.0 -v -p hello
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 68 65 6C 6C 6F __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ | hello
RX | 68 65 6C 6C 6F __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ | hello
Do you modify the frequency for SPI interface?
Yes, I see its default frequency in dtb is 50000000, so I change it in spidev_test.c
Hello, Kevin. I reduced the spi frequency in spidev_test.c and both SPI interface works fine.
It seems due to the frequency, thank you for help!
But I still wonder why SPI1 works fine while SPI3 don’t in the same high frequency.
It may relate to the default clock used for SPI3.
The clock frequency for SPI3 is lower than SPI1 by default.
1 Like
system
Closed
January 1, 2024, 8:16am
10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.