I am currently using the i.MX8MM ECSPI Slave in PIO mode.
The issue is that in Slave mode, the burst length appears to be limited to 512 bytes.
While it's not clear whether using DMA mode instead of PIO mode would remove the transmission data size limitation, I have applied a kernel patch to try using DMA mode.
Can I get sample code or materials related to SPI data transmission and reception in Slave mode(using DMA)?
I am referring to the AN13633 document, but I would appreciate any comments if there are other helpful resources available.
Let me know if you would like me to help you find specific resources or documentation about implementing DMA mode for ECSPI on i.MX8MM.
Solved! Go to Solution.
double checked again, this limitation is HW limitation, the AN is released and based on the old bsp, the new bsp add 512 bytes limitation because of HW limitation, so you couldn't remove this, it seems imx8mm ecspi couldn't support this(no 512 bytes limitation) if you want to use slave mode
AN13633 is very detailed application note for your request, for dma support, you also can refer to the patch as below, and you also can focus on the ERR003775 from errata
LF-6680 spi: imx: add dma support for target mode · nxp-imx/linux-imx@1aef8ed · GitHub
Thank you for your response.
I was trying to enable DMA mode thinking there were no transfer size restrictions in DMA mode.
Based on the linked document, does it mean that both PIO and DMA modes have a 512-byte limit for transfer data size?
yes, DMA has this limtitaion too
I checked the driver again, the limitation is
https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/drivers/spi/spi-imx.c#L1492
if you want to test this, you can comment the 512 limitation to test based on your detailed user case
Thank you for your reply.
But, I didn't understand exactly what you said.
Does annotating the 512 byte limit in kernel code mean I can transfer more than 512 bytes in SPI Slave mode?
if ((is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx)) &&transfer->len > MX53_MAX_TRANSFER_BYTES && spi_imx->target_mode) {
dev_err(spi_imx->dev, "Transaction too big, max size is %d bytes\n",
MX53_MAX_TRANSFER_BYTES);
return -EMSGSIZE;
}
double checked again, this limitation is HW limitation, the AN is released and based on the old bsp, the new bsp add 512 bytes limitation because of HW limitation, so you couldn't remove this, it seems imx8mm ecspi couldn't support this(no 512 bytes limitation) if you want to use slave mode
Thank you for your quick response.
Have a nice day.
confirmed that DMA/PIO mode has 512 limitation, and DMA has 4 bytes align limitation, you can refer to the patch I sent to you before
Thank you for your quick reply.