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.

[OMAP-L138] What clears the DMA Events for the SPI module of the L138?

Other Parts Discussed in Thread: OMAP-L138, OMAPL138

After a DMA is completed, how do you ensure that the REVT or XEVT are cleared?

Does an SPI reset clear these events?

  • Are you asking how does the REVT/XEVT get cleared at the EDMA side?

     

  • Looking at the OMAP-L138 SPI User's Guide the functional block diagram shows that the SPI module provides the REVT and XEVT that signals when a receive or transmit DMA event has occurred. My question then is, when I want to ensure that the REVT/XEVT are clear before I start a new DMA request how do I do this?

  • Hi Grant

    The peripheral events that are latched in the EDMA3 ER registser (like REVT, XEVT) will get automatically cleared (in hardware), once the event is serviced by the EDMA. You can find this detail in the "Event Dataflow" section in the EDMA3 user guide.

    Let us know if you need any additional clarifications.

    Regards

    Mukul

  • Hi Mukul,

    Thanks for the clarification but my question is how can I clear the SPI REVT even if it has not been serviced by the EDMA? The reason for this is that I have written an SPI driver (slave mode) and use EDMA to receive data from the master. Now on the first successful transfer I always get the correct data, but on succeeding transfers I get an additional byte and it is always the first byte received.

  • Grant

    It would seem like something is wrong with your setup or software sequence? Clearing the latched event will not address the problem. However if you do want to try it, the event latched in ER can be cleared by writing a 1 to the corresponding event in the event clear register ECR

     

    FYI, For simple SPI examples with EDMA you might also want to look at Sitaraware. This software is available for AM18xx which is a pin compatible device from the same family as OMAPL138, the underlying EDMA and SPI is the same and so the code here can be used as referece to develop an ARM or DSP side driver

    http://processors.wiki.ti.com/index.php/AM18XX_SitaraWare_SerialDevices#DMA_Mode_4

    Regards

    Mukul