Known issues with UART interrupt and free-run DMA?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Known issues with UART interrupt and free-run DMA?

1,093 Views
fangsbones
Contributor I

I am using K61 processor and am successfully communicating across UART0 and UART1, each configured with separate DMAs for RX and TX in free run. The existing solution works well when the application continuously polls the RX DMA location. However, to save power we must switch the application from constantly polling the DMA output to an interrupt-driven solution.

The ideal solution is to allow our application to stop polling the UART RX DMA output location, and use an interrupt to wake our task and begin polling UART RX DMA output. The interrupt for UART RX could be a Port interrupt (i.e. PB16_PCR register) or a UART interrupt (e.g. UART0_S2_RXEDGIE).

However, we have tested both of these solutions and enabling either of these interrupts appears to corrupt our free-running DMA in the following manner: When data is active on the UART RX pin, then the DMA runs correctly and we get data. But when data is no longer active on the UART RX pin, then the DMA stops processing/accepting new data. The remainder of the data only gets processed the next time there is active data on the UART RX pin. A strange observation is that there are always 7 bytes "missing" (i.e. not read into DMA) after the active data on the UART RX pin stops.

We want to keep DMA free-running because of the high throughput.

Are there any known issues with configuring an UART or PORT interrupts when using a UART RX in DMA free-run?

Tags (2)
0 Kudos
2 Replies

590 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Andrejs,

I did a similar test on TWR-K22F120M board with the demo of uart_edma_blocking out of ksdk 1.3, it works well with RXEDGIF interrupt enabled. Please refer to the following for details.

pastedImage_0.png

so I think it might be a software issue, the following is the interrupt service for UART1, so far I just clear the RXEDGIF flag in it, is it the same as your code?

void uart1_rxegif_int()

{

  if(UART1_S2 && UART_S2_RXEDGIF_MASK)

  {

    UART1_S2 |= UART_S2_RXEDGIF_MASK;

  }   

}


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

590 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello And,

Does the data need to be transfer by DMA is  the UART data ?

If yes , i think you can use the UART trigger a DMA request .

pastedImage_0.png

Hope it helps


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos