IMX8M Plus ECSPI slave mode DMA restriction

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

IMX8M Plus ECSPI slave mode DMA restriction

Jump to solution
309 Views
atessadri
Contributor I

According to NXP document attached AN13633 it seams not possible to use DMA when ECSPI controller is used in slave mode.

This limitation has the following effects on driver:
1. In slave mode, DMA can’t be used. Instead, only PIO mode can be used. It is based on the following
considerations:
a. To use DMA mode, the burst size must be 4 byte aligned.
b. The ECSPI driver must support unaligned transfer size.
2. The burst size must be set to transfer size in PIO mode. But maximum burst size is 2^12 = 512 bytes. So
ECSPI driver can transfer maximum 512 bytes in a PIO transfer.
Note: From testing, it seems no such transfer length restriction must be added in DMA mode. So only PIO
mode has this restriction.

Anyway in the footer note it says there is no such transfer restriction, so I am wondering if DMA can be used as well with a data transfer 4 bytes aligned.

We have complete control on the slave master sending packets, so we can be compliant with the restriction to use a 4 bytes aligned transfer.

Will it be enough to have DMA transfer with ECSPI in slave mode ?

Our idea is to trigger a SMART DMA script for each SPI received packet so that a dedicated memory buffer will be filled with packed content according to an index added to the packet header to calculate the buffer offset where to copy packet data.

 

Thanks

   Andrea

Tags (3)
0 Kudos
Reply
1 Solution
266 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @atessadri 

We have not done such testing, but i think you are right, If you can fully control the transfer on the SPI master side and ensure that all data blocks are 4-byte aligned, then using DMA for ECSPI slave data reception is theoretically feasible, but the ECSPI driver may need to be appropriately modified to support DMA transfer in slave mode.

B.R

View solution in original post

1 Reply
267 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @atessadri 

We have not done such testing, but i think you are right, If you can fully control the transfer on the SPI master side and ensure that all data blocks are 4-byte aligned, then using DMA for ECSPI slave data reception is theoretically feasible, but the ECSPI driver may need to be appropriately modified to support DMA transfer in slave mode.

B.R