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.

RTOS/TM4C1294NCPDT: SPI DMA in slave mode not working properly

Part Number: TM4C1294NCPDT

Tool/software: TI-RTOS

Hi,

I am configuring SPI DMA in slave mode, if I configure the device in master mode its working fine.

In slave mode, the transfer initiated without the master providing the clock.

Even if the SPI RX buffer is empty, Empty data's are send to the DMA RX buffer and processed.

Why this the happening? I cannot configure SPI DMA in slave mode?

Regards,

Manohar

  • Hi Manohar,
    What might have happened was that when you enabled the DMARX it immediately generated a DMA request to the DMA module to kick start the transfer. The uDMA does not know if the SSI has really received data or not. It based on the DMA request from the SSI. I have one suggestion that you can try is to monitor the EOT bit before you enable the DMARX. Since the SSI is duplex it has to transmit and receive at the same time. If it completes the transmit after it receives the SSICLK from the master it will set the EOT bit. This also means it has received the data from the master. I hope you only need to this once for the very first time. All the subsequent receive data it will generate the DMA request upon data is written to the SSI receive buffer.
  • Hi,

    This way of implementation will work for first data transfer to receive and transmit data correctly. Since the RX channel is configured in Ping Pong mode as slave SPI. Once its initiated, it keep on taking data's from the SPI receiver buffer, Even the buffer received no data.

    From now, I can be able to receive correctly from your above implementation idea. But it works only for the first time of data transfer.
    Continuous transfer, I am encountering the above error.



    Regards,
    Manohar
  • Hi,

    I am just using a SPI0 TX channel in Slave mode with Ping pong transfer. That if a external clock given to the controller it should send the data's out.

    But without providing the clock, why the TX channel keep on replacing the data in the SPI buffer. if I read the data, its not giving the data from the beginning.

    Always reading from some random starting data.




    Regards,
    Manohar

  • Hi Manohar,
    I don't know if this thread is related to the other thread you have e2e.ti.com/.../2323040. Please refer to the other thread to remove the system_printf() and system_flush and see if you still have the problem.
  • Hi Charles,

    The continuous data transfer in slave device is because the Analyser keep on sending some noise in clock pin. Which makes the data to swap when I am reading the data from slave device.

    Thank you.


    Regards,
    Manohar