December 6, 2022, 6:01am
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:
purple line: SPI Clock
blue line: SPI MISO
red circle is the zone of 2 bytes data transfer
clock rate: 1MHz
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?
Thanks for your reported, we are checking it.
December 7, 2022, 5:51am
I run a custom built os based on open-embedded.
When I tested it with the original ubuntu-based os, it had similar pattern but it was worse:
December 7, 2022, 6:56am
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?
December 7, 2022, 10:39pm
I got this info from the following command:
sys.kernel.debug.gpio.txt (8.7 KB)
How can I know if this is correct or not?
Usually we use jetson-io to configure the pins for XNX.
December 9, 2022, 3:08am
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 link has the same problem:
How can I reduce the spi access delay?
December 11, 2022, 10:26pm
I am sorry it was version 5.0.2
January 11, 2023, 4:28am
From the research so far, I think this delay comes from not misconfiguration but latency of the function calls in tegra spi driver. Can you help me?
February 7, 2023, 6:27am
Sorry for the late response, is this still an issue to support? Thanks
February 7, 2023, 6:33am
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.
February 21, 2023, 6:46am
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.