I am using a modified spidev_test.c that transfers 31 two-byte messages without a delay.
With the same code, I built binaries, one for raspberry pi 4B and the other for Jetson Xavier NX.
Both can read the data correctly. But the interval of message is very different:
Q1: Why is the interval of NX data transfer longer than PI and irregular?
Q2: I am using the device that needs to set the clock polarity high. It is high in idle at PI, but it goes to low in NX. Why is that?
It looks like that this problem is related to the configuration of device tree / pinmux.
Could you advise me which config can cause this problem if my guess is correct?
I have installed SDK Manager and flash the new firmware jetpack 5.0.1 to the NX devkit.
I enabled spi pins in pin header using jetson-io.
Then run “sudo modprobe spidev” after rebooting.
Unfortunately, nothing is changed in the oscilloscope signal.
I found this problem comes from the context switching time of Linux. So I decided to use the SPI hardware delay that spi-tegra114 kernel driver supports.