AnsweredAssumed Answered

UART RX DMA on MPC5645S

Question asked by Thomas Huettenhofer on Mar 29, 2017
Latest reply on Jun 29, 2017 by soledad

Hi.

 

In our project we receive data via UART (linflexd1). For this functionality, the MQX UART driver with interrupts is used. With a baud rate of 115200, the 4 byte RX buffer is overflowing , before the RX interrupt can copy the data.

 

To work around this limitation, I'm using UART RX DMA for receiving the data without using interrupts.

For testing purposes I configured the eDMA to do 4 major iterations, one byte each and generate an end-of-major loop interrupt afterwards. This basically works fine.

However, in about half of the transfers, additional bytes with the value of Zero are copied by the DMA engine. For example, sending 4 bytes "abcd" might be "a", "b", "c", 0x0, "d" in the DMA destination buffer. Sometimes its one Zero byte, sometimes two. Also the position is different each time. The Zero byte also occurs, if no end-of-major loop interrupt is configured. I already did a measurement of the RX line with an oscilloscope/logic analyzer: there are no additional bytes on the wire, which would explain this behaviour.

 

It seems to me, that sometimes a DMA transfer is triggered, when no new data is in the UART RX FIFO. Thus, a byte with the value zero is transfered.

 

Has anyone experience with UART RX DMA transfers and/or got it working reliable?

 

I can also supply the configuration of UART, DMAMUX and eDMA if this helps.

 

Thanks.

 

With best regards,

Thomas Huettenhofer

Outcomes