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.

How to discard the DMA transfer of an incompletely received message?

I have a project with two SCI modules receiving two remote, slow devices each sending one 16-byte, 8.3-ms message every 20 ms. The messages may overlap, so I use 1-byte frames and BYPASS the FIFO. IFTCOUNT is 15 (I use an interrupt on the first byte of each message). In the ISR, a HET-controlled timer is captured and CFTCOUNT is checked. If >0, the previous message was corrupted, and the DMA transfer has to be discarded (and re-enabled anyway) in order to align the current message with the destination buffer.

My idea how to discard has been the very same as in the following thread: e2e.ti.com/.../427768
but that thread stopped short of a full understanding of what has been going on.

May be that a copy of the register onto itself is not enough. The TRM reads "Changing the contents ...".

  • First, I would not use CFTCOUNT in the application. It is something used by DMA internally. You can check the BTC flag to see if the DMA block transfer is completed. According to TRM, changing the contents of the channel control packet will stop the channel. You can first write a different value to the control packet. Waiting for the pending bit is cleared. Disable the channel. Reconfigure the control packet and re-enable the channel.

    Thanks and regards,

    Zhaohong