Spi slave problem ,the received information cannot exceed 256 bytes

this is my device tree,
spi@c260000 {
compatible = “nvidia,tegra186-spi-slave”;
/compatible = “nvidia,tegra234-spi-slave-cnt-mode”;/
spi-max-frequency = <50000000>;
status = “okay”;
spi@0 {
compatible = “tegra-spidev”;
reg = <0x0>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
When receiving more than 256 bytes of data, there is an error:
[ 2494.986859] tegra-gpcdma 2600000.gpcdma: slave id already in use
[ 2494.993063] spi-tegra124-slave c260000.spi: Not able to get desc for Tx
[ 2494.999890] spi-tegra124-slave c260000.spi: Starting tx dma failed, err -5
[ 2495.006990] spi-tegra124-slave c260000.spi: spi can not start transfer, err -5
[ 2495.007010] spi_master spi1: failed to transfer one message from queue
I would like help

It looks like you use SPI2 pins of Orin. Please help share setting of the pins for reference:

/home/ubuntu# busybox devmem 0x0c302048
/home/ubuntu# busybox devmem 0x0c302050
/home/ubuntu# busybox devmem 0x0c302028
/home/ubuntu# busybox devmem 0x0c302038

Hi,Thanks for your reply.
this is my setting of the pins :
titan@titan:~$ sudo busybox devmem 0x0c302048
[sudo] password for titan:
titan@titan:~$ sudo busybox devmem 0x0c302050
titan@titan:~$ sudo busybox devmem 0x0c302028
titan@titan:~$ sudo busybox devmem 0x0c302038

hello,has there been any progress on this issue?

The registers looks correct. We are checking further with our teams. Is is fine to send data in maximum 256 bytes as a quick solution?

For information, do you use Jetpack 5.1(r35.2.1)?

Can you share the final dtb here which is under /boot/dtb on the target ? Want to check which GPCDMA Channel your trying to use. From the log it shows that the gpcdma channel is under use so try using a different gpcdma channel which is free you can check the status of the gpcdma channels in /sys/class/dma

kernel_tegra234-p3701-0000-p3737-0000 .dtb (335.1 KB)

hello,i use jetpack5.0.2

Can you also share the test commands that your using. What are you trying to verify here by configuring controller 2 i.e. spi@c26 as slave ?

I use mcu master to continuously send data to orin
I run ./spidev_test -D /dev/spidev1.0 -H -s10000000 -v -p +data,for example ./spidev_test -D /dev/spidev1.0 -H -s10000000 -v -p abcd,It will fail when my data exceeds 256 bytes

Can you once check if data integrity matches if you send some bytes of data from master and check if same data is received by slave ? I mean something like this

  • ./spidev_test -D /dev/spidev0.0 -s8000000 -g512 -b32 -H -p0 -n1 -r (This is the orin slave)
  • ./spidev_test -D /dev/spidev1.0 -s8000000 -g512 -b32 -H -p0 -n1 -zzz -t (this should be your mcu master)

Ensure you send fixed amount of data like 256 or 512 bytes

hello,my spidev_test doesn’t have -g,
titan@titan:~$ spidev_test -g
spidev_test: invalid option – ‘g’
Usage: spidev_test [-DsbdlHOLC3vpNR24SI]
-D --device device to use (default /dev/spidev1.1)
-s --speed max speed (Hz)
-d --delay delay (usec)
-b --bpw bits per word
-i --input input data from a file (e.g. “test.bin”)
-o --output output data to a file (e.g. “results.bin”)
-l --loop loopback
-H --cpha clock phase
-O --cpol clock polarity
-L --lsb least significant bit first
-C --cs-high chip select active high
-3 --3wire SI/SO signals shared
-v --verbose Verbose (show tx buffer)
-p Send data (e.g. “1234\xde\xad”)
-N --no-cs no chip select
-R --ready slave pulls low to pause
-2 --dual dual transfer
-4 --quad quad transfer
-8 --octal octal transfer
-S --size transfer size
-I --iter iterations

Can you try using the tool provided in the below comment ? Follow the steps mentioned.

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