Spi no can’t communicate

Signals (SCL) are high on Oscilloscope,but no any wave happened.

$ sudo ./spidev_test -v -s 65000000 -p 123456 -D /dev/spidev2.1
spi mode: 0x0
bits per word: 8
max speed: 65000000 Hz (65000 KHz)
speed 65000000
speed 65000000
TX | 31 32 33 34 35 36 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ | 123456
RX | 00 00 00 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ | …

test.c link:

kernel log:


[    0.738329] iommu: Adding device 3210000.spi to group 8
[    0.738730] iommu: Adding device 3230000.spi to group 9
[    0.739130] iommu: Adding device 3270000.spi to group 10
[    1.629040] qspi_mtd spi6.0: s25fs256s SSG 8 0 1000 2000000
[    1.629078] qspi_mtd spi6.0: s25fs256s (32768 Kbytes)
[    1.629109] qspi_mtd spi6.0: mtd .name = spi6.0, .size = 0x2000000 (32MiB) .erasesize = 0x00010000 (64KiB) .numeraseregions = 0
[    1.629414] 1 ofpart partitions found on MTD device spi6.0
[    1.629439] Creating 1 MTD partitions on "spi6.0":
[ 1196.282488] spi-tegra114 3230000.spi: CpuXfer ERROR bit set 0x1c00004
[ 1196.282611] spi-tegra114 3230000.spi: CpuXfer 0x47e01827:0x00000000
[ 1196.282686] spi-tegra114 3230000.spi: SPI_ERR: CMD_0: 0x47e01827, FIFO_STS: 0x01c00004
[ 1196.282766] spi-tegra114 3230000.spi: Error in Transfer
[ 1196.282820] spi_master spi2: failed to transfer one message from queue
[ 1196.282876] spi-tegra114 3230000.spi: SPI_ERR: DMA_CTL: 0x00000000, TRANS_STS: 0x40ff000c
[ 1260.075491] spi-tegra114 3230000.spi: CpuXfer ERROR bit set 0x400005
[ 1260.075519] spi-tegra114 3230000.spi: CpuXfer 0x43e01827:0x00000000
[ 1260.075540] spi-tegra114 3230000.spi: SPI_ERR: CMD_0: 0x43e01827, FIFO_STS: 0x00400005
[ 1260.075550] spi-tegra114 3230000.spi: Error in Transfer
[ 1260.075562] spi-tegra114 3230000.spi: SPI_ERR: DMA_CTL: 0x00000000, TRANS_STS: 0x40ff0000
[ 1260.075568] spi_master spi2: failed to transfer one message from queue
[ 1293.154611] spi-tegra114 3210000.spi: CpuXfer ERROR bit set 0x400005
[ 1293.154635] spi-tegra114 3210000.spi: CpuXfer 0x43e01827:0x00000000
[ 1293.154656] spi-tegra114 3210000.spi: SPI_ERR: CMD_0: 0x43e01827, FIFO_STS: 0x00400005
[ 1293.154661] spi-tegra114 3210000.spi: Error in Transfer
[ 1293.154676] spi_master spi0: failed to transfer one message from queue
[ 1293.154689] spi-tegra114 3210000.spi: SPI_ERR: DMA_CTL: 0x00000000, TRANS_STS: 0x40ff0000
[ 1317.776203] spi-tegra114 3210000.spi: CpuXfer ERROR bit set 0x400005
[ 1317.776231] spi-tegra114 3210000.spi: CpuXfer 0x47e01827:0x00000000
[ 1317.776252] spi-tegra114 3210000.spi: SPI_ERR: CMD_0: 0x47e01827, FIFO_STS: 0x00400005
[ 1317.776256] spi-tegra114 3210000.spi: Error in Transfer
[ 1317.776269] spi_master spi0: failed to transfer one message from queue
[ 1317.776306] spi-tegra114 3210000.spi: SPI_ERR: DMA_CTL: 0x00000000, TRANS_STS: 0x40ff0000

Did you run the jetson-io to enable the SPI pin configure?

hi,

1.Did you run the jetson-io to enable the SPI pin configure

->I cannot configure, how enable the SPI pin configure?or check SPI pin configure,Thanks

$ ls /dev/spidev*
/dev/spidev0.0  /dev/spidev0.1  /dev/spidev2.0  /dev/spidev2.1

hardware is SPI1_SCK、SPI1_SCK、SPI1_MOSI、SPI1_CS0 to gnes chip.
1629351593(1)

3.platform/t19x/jakku/kernel-dts/common/tegra194-p3668-common.dtsi flow as:

402     spi@3210000{ /* SPI1 in 40 pin conn */
403         status = "okay";
404         spi@0 { /* chip select 0 */
405             compatible = "spidev";
406             reg = <0x0>;
407             spi-max-frequency = <50000000>;
408             controller-data {
409                 nvidia,enable-hw-based-cs;
410                 nvidia,rx-clk-tap-delay = <0x10>;
411                 nvidia,tx-clk-tap-delay = <0x0>;
412             };
413         };
414         spi@1 { /* chip select 1 */
415             compatible = "spidev";
416             reg = <0x1>;
417             spi-max-frequency = <50000000>;
418             controller-data {
419                 nvidia,enable-hw-based-cs;
420                 nvidia,rx-clk-tap-delay = <0x10>;
421                 nvidia,tx-clk-tap-delay = <0x0>;
422             };
423         };
424     };
425
426     spi@3230000{ /* SPI3 in 40 pin conn */
427         status = "okay";
428         spi@0 { /* chip select 0 */
429             compatible = "spidev";
430             reg = <0x0>;
431             spi-max-frequency = <50000000>;
432             controller-data {
433                 nvidia,enable-hw-based-cs;
434                 nvidia,rx-clk-tap-delay = <0x10>;
435                 nvidia,tx-clk-tap-delay = <0x0>;
436             };
437         };
438         spi@1 { /* chips select 1 */
439             compatible = "spidev";
440             reg = <0x1>;
441             spi-max-frequency = <50000000>;
442             controller-data {
443                 nvidia,enable-hw-based-cs;
444                 nvidia,rx-clk-tap-delay = <0x10>;
445                 nvidia,tx-clk-tap-delay = <0x0>;
446             };
447         };
448     };

Check this doc to run the jetson-io to configure it.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html#

ok, i try ,Thanks.