Post Go back to editing

UART DMA IDLE Detection

Thread Summary

The user asks about handling partial UART RX buffer fills on the ADSP-21569, specifically how to detect and read out 31 bytes without a callback. The final answer suggests polling the DMA_STAT.RUN and DMA_XCNT registers to check the DMA status and determine if data is available. The accompanying answer mentions the UART Mode LIN Break Command, which requires the sender to pull the UART line low for at least one full frame, but this may not be applicable if the sender does not support it.
AI Generated Content
Category: Software
Product Number: ADSP-21569
Software Version: CCES 2.12.1

Hey together, 

I have a question regarding the UART RX on the ADSP-21569. I managed to build a continous DMA receiver by using 2 descriptors pointing circular to each other, thats perfect. The size of the buffers are 32 byte. So this means I always get an callback when i received 32 bytes via UART. But what happens when I only receive 31 bytes for whatever reason. I will not get any callback and the data stays in the buffer forever. Is there a way to detect, for example after 100ms, that there is data in the buffer and to read it out? 

On some know MCUs this is done via the UART IDLE detection. Meaning when there is silence for more that 1 byte on the bus the UART IDLE interrupt is triggered and the data can be flushed from the DMA. I cant find any information about the IDLE interrupt but maybe there is a way to do it via polling, every 100ms or so. 

Best regards,

Eric  

Thread Notes

Parents Reply
  • Hi Eric,

    Unfortunately, the UART device driver does not provide an API to poll the DMA status. However, within the DMA controller, the DMA_STAT.RUN bit indicates the current operational state of the DMA. You can poll the DMA_STAT.RUN and DMA_XCNT registers to determine the status.
    Please note that the DMA channel transitions to the IDLE state once the work unit is completed.

    Regards,
    Nandini C

Children
No Data