This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Configuring DMA for SPI operating in slave mode



Hello,

I have DM8148, and trying to get the DMA configured for SPI module when it is operating in Slave mode. I got the DMA working well when the SPI in Master mode only. Is there a reference configurations that I can use for the slave mode?

  • Hi Karim,

    I think the SPI slave mode is not tested, check here : http://processors.wiki.ti.com/index.php/TI81XX_PSP_McSPI_Driver_Guide

    We have useful info here also:

    http://e2e.ti.com/support/embedded/bios/f/355/p/123270/439709.aspx

    Regards,

    Pavel

  • Hello Pavel,

    Thank for the urls you have sent, as far as I understood, that PSP doesn't support DMA for SPI under slave mode,but is there a way other than using PSP to configure the DMA for SPI operating under slave mode.

    Note:

    I already could configure the SPI to operate under slave mode, but the processor gets interrupted every time to transfer data to DDR, and I need to do that without interrupting the processor.

  • Hi Karim,

    You can disable interrupting the processor (Cortex-A8) from two sides:

    1. At McSPI module side, with MCSPI_IRQENABLE register. Make sure its value is 0x00000000, thus all kind of McSPI interrupt requests are disabled

    2. At Cortex-A8 Interrupt Controller side, see chapter 14 ARM Interrupt Controller (AINTC)

    Regards,

    Pavel

  • Pavel,

    But hence I wouldn't be notified to transfer the data from SPI to DDR, and I need that process to be done without interrupting A8.

    So, is there a way -Other than using the PSP- to configure the DMA to handle the data transfer from SPI in slave mode to the DDR ?

  • Hello,

    Disabling the interrupt request signals from the McSPI towards the A8, does not prevent you to organize the data transfer from McSPI to DDR. You will use DMA mode (thus not involve the A8 in the data transfer), instead of interrupt or polling mode (where the A8 is involved in the data transfer). 

    When data in McSPI is ready to be transferred, the McSPI will generate a DMA request towards the system DMA controller. And the system DMA controller will transfer the data from the McSPI to the DDR. And when the transfer is ready, the DMA controller will notify the A8.

    You can check the DM814x TRM, section 22.2.6 DMA Requests.

    Regards,

    Pavel