Can not get SPI signal with preempt_rt Linux kernel

My device is AGX Xavier devkit, and software version is r35.3.1 with preempt_rt real-time Linux kernel following this tutorial. I can get the following information by running command uname -a:

Linux jetson 5.10.104-rt63-tegra #1 SMP PREEMPT RT

Then, I run the following command to load spidev module:

sudo modprobe spidev
ls /dev/ | grep spidev
spidev0.0
spidev0.1

Then I short pin19(MOSI) and pin21(MISO) of J30, and run the following spidev_test command:

./spidev_test -D /dev/spidev0.0 -s 10000000 -v

and output information:

spi mode: 0x0
bits per word: 8
max speed: 10000000 Hz (10000 kHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D  |......@.........................|
RX | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................................|

I know it means spi works failed. However the SPI works fine in normal Linux kernel of r35.3.1.
How to deal with this issue?

Hi Xu_Xu,

Do you mean it work with the same steps and setup in normal Linux kernel?

Could you help to share the dmesg in both cases?

Yes.
What’s more, by using scope, I can not capture any signal from SCK, MOSI, MISO, or CS pin on the rt kernel.
dmesg_rt_kernel.txt (74.1 KB)
dmesg_normal_kernel.txt (75.1 KB)

Do you have NVMe SSD connected on your board?

I found they boot from different devices. (mmcblk0p1 and nvme0n1p1)

[    0.000000] Kernel command line: root=/dev/nvme0n1p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 video=efifb:off
..
[    8.103388] Root device found: nvme0n1p1
[    8.116585] Found dev node: /dev/nvme0n1p1
[    8.151531] EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Opts: (null)
[    8.156309] Rootfs mounted over nvme0n1p1

Yes. I have two agx xavier devkits(one run normal kernel, another run rt kernel). Both devkits have NVMe SSD. But, in normal linux, kernel is booted from nvme0n1p1. In rt kernel, it is booted from mmcblk0p1. Because I used different flash command.

The tutorial you referred is for R35.1.

Could you refer to the following instruction from developer guide to build runtime kernel instead?
Kernel Customization — To Build the Real-Time Kernel

Thank for your help.
I have figure out the reason about this issue. In rt kernel, the pinmux of spi1 doesn’t config correctly.

1 Like

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