iMX, SPI SDMA, Problem with long transfer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX, SPI SDMA, Problem with long transfer

2,031 Views
sfe
Contributor II

Hello!

I'm working on a iMX7d with kernel 4.1.15 from the freescale repo. But the same happened on an iMX6q with the same kernel.

I want to use SPI with activated SDMA.

It works fine with 64 bytes in one burst. When I increase to 128 bytes the transfer times out after 3s. And transfers after that block my device.

The timeout happens in drivers/spi/spi-imx.c in function spi_imx_dma_transfer. 3s is the default timeout.

I got lost in the interaction of spidev, spi, spi-imx and dmaengine and was hoping anybody had a similar experience and maybe a solution for it. Or an idea what to look at.

Thanks and best regards,

Sebastian

PS:

The spi is used by the spidev driver.

PPS:

Output:

spi mode: 0x3
bits per word: 32
max speed: 500000 Hz (500 KHz)
size 127
len 128, delay 0, speed 500000, bpw 32
[   82.184335] spi_master spi0: I/O Error in DMA TX:80
[   82.190269] spi_master spi0: failed to transfer one message from queue
can't send spi message: Connection timed out
./sendSPI.sh: line 13:   465 Aborted                 ./spi-tool -D /dev/spidev0.1 -b32 -H -O -p "12345678901234567890123456789012345678902345678901234567890123456789012345678901234567890123456789012346578901234567980123456789"

spi-tool is the spidev test tool included in the kernel sources.

Labels (3)
7 Replies

1,227 Views
sfe
Contributor II

Hi,

having the SDMA firmware available helps.
It needs to be present in the filesystem to be loaded by the kernel.

/lib/firmware/imx/sdma

There is a download of the binary (that's the only way you get it from NXP) somewhere. But I can't find the note in my documents right now.

I hope that helps. Sorry for not having the links on hand.

Regards,

Sebastian

0 Kudos

1,204 Views
ceggers
Contributor V
SDMA firmware can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/imx/sdma

For i.MX8, the file sdma-imx7d.bin must be copied to /lib/firmware/

regards,
Christian
0 Kudos

1,201 Views
ppavacic
Contributor II

Thank you for your reply,

Sadly I already have sdma-imx7d.bin so that isn't the problem.

Regards,

Paulo

0 Kudos

1,198 Views
ceggers
Contributor V
Hi Paulo,

do you also use kernel 4.1.15 from NXP? I think that this version is a little bit outdated.

regards,
Christian
0 Kudos

1,193 Views
ppavacic
Contributor II

Hi,

I'm using kernel version 5.15.

Regards,

Paulo

 

0 Kudos

1,185 Views
ceggers
Contributor V

Can you please share some more details?

  • What exactly does not work?
  • Which error messages to you get?
  • Which error codes do you get in the driver / your application?

regards,
Christian

0 Kudos

1,240 Views
ppavacic
Contributor II

Hi, I was wondering whether you have found solution to your problem. I have same problem on imx8m.

0 Kudos