A spi error occurred during 3.5” Waveshare touchscreen setup

Hello.
I’m trying to use a 3.5inch HDMI LCD, 480x320, IPS touchscreen on a jetson xavier nx.

I saw this post and followed it, and the spi1 was modified for Jetson Xavier NX (maybe I was wrong)

spi@1 {
compatible = “ti,ads7846”;
reg = <0x1>; // CS1 of SPI
spi-max-frequency = <0x7a120>;
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x7>;
interrupt-parent = <0x13>; // phandle of "gpio@2200000"
interrupts = <0x42 0x1>;
pendown-gpio = <0x13 0x42 0x0>;
vcc-supply = <0x27>; // phandle of "regulator@101"
//ti,swap-xy = <0x1>; // uncomment to swap axes
ti,x-min = [00 00];
ti,x-max = [1f 40];
ti,y-min = [00 00];
ti,y-max = [12 c0];
ti,x-plate-ohms = [00 28];
ti,pressure-max = [00 ff];
wakeup-source;
controller-data {
nvidia,cs-setup-clk-count = <0x1e>;
nvidia,cs-hold-clk-count = <0x1e>;
nvidia,rx-clk-tap-delay = <0x1f>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};

I rebooted and checked the error message from dmesg.


What is this error message?
What am I doing wrong?

For NX the SPI1 is mapping to spi@0.

I wrote the content in spi@0. But I get the same error.
Under what circumstances does the error message I have occur?

I would suggest to try the loopback mode first to confirm the configure is correct.

When spidev is tested by connecting mosi-miso of spi1, it works normally.

That tell the pinmux configure without problem. The problem could be the device problem cause the transfer error.

The spi of jetson xavier nx does not have a problem, but is it that transmission errors may occur due to a device problem (touch screen in this case)?

Yes, it could be the touch screen may have problem to ack the SPI command.

I have done a touchscreen test on the jetson nano.
Since jetson xavier nx and jetson nano are pin compatible, I thought it would be successful if you change the value according to jetson xavier nx.

Can an error occur even if jetson xavier nx and jetson nano are pin compatible?

Yes, but the pin mapping maybe different. Like GPIO number could be different.

Are you saying that the pinmux configuration could be different?

+)Can you please confirm that I changed the values ​​correctly?

Before change
nvidia,rx-clk-tap-delay = <0x7>;
interrupt-parent = <0x56>; // phandle of “gpio@6000d000”
interrupts = <0x0d 0x1>; // pin 22 is gpio13, IRQ13
pendown-gpio = <0x56 0x0d 0x0>;
vcc-supply = <0x47>; // phandle of “regulator@2”

After change
nvidia, rx-clk-tap-delay = <0x10>;
Interrupt parent = <0x13>; // “gpio @ 2200000”
Interrupt phandle = <0x42 0x1>;
Pen down -gpio = <0x13 0x42 0x0>;
vcc-supply = <0x27>; // phandle of “regulator @ 101”

I didn’t understand about “// pin 22 is gpio13, IRQ13” (I’m not sure what value to put in jetson xavier NX).
So I checked IRQ13 of jetson nano.
The jetson nano’s IRQ13 was 6000c800.actmon.
As a result of checking the interrupt of jetson xavier NX, the IRQ corresponding to actmon in jetson xavier NX was 66.
So I changed 0x0d to 0x42.

That’s depend on your connection I can’t help on it.

What is the irq of gpio pin 22 in jetson xavier nx?

please access pinmux spreadsheets from download center to have reference.