Loopback in uart using DMA is not working as expected.

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

Loopback in uart using DMA is not working as expected.

538 Views
madhavaishriram
Contributor II

Hi all,

I am using MKE15Z265VLL7 FRDM board and trying to use the DMA for uart .

DMA0 channel 2 for tx and DMA0 channel 3 for rx. the sequence for loopback is  to call send api and after some delay calling receive api. and tx and rx is shorted using cable.

if is try this sequence send-delay-receive data is not receiving on receive api.

But if i try the sequence receive-delay-send then data is received on receive api.

So please if any one is having any suggestion please let me know.

 

Attached the code snippet from nxp code.

madhavaishriram_0-1664772674289.png

with this it is not receiving any data on rx line.

madhavaishriram_1-1664772742215.png

if i try this then i can see the data on rx line.

 

Thanks in advanced.

0 Kudos
3 Replies

520 Views
Miguel04
NXP TechSupport
NXP TechSupport

Hi @madhavaishriram 

I am Miguel, I will support you with your case.

This issue could be that the UART buffer is full, this could be why sending-delay-reading doesn’t work and receiving-delay-send works fine. You could try changing the logic on your code and make more use of the registers flags to make sure the buffer and DMA are ready to transmit and receive data.

You can verify that the buffer is empty with the peripherals tool on DATA register or you could validate the flags (check reference manual, TC, RDRF, TDRE) on the STAT register.

Let us know if this resolve your issue.

 

Best regards,

Miguel.

0 Kudos

477 Views
madhavaishriram
Contributor II

Used status register to wait until transmission complete and reception but still having same issue..

0 Kudos

451 Views
Miguel04
NXP TechSupport
NXP TechSupport

Hi @madhavaishriram 

Could you help me verifying that the data buffer is empty before sending data (RDRF and TDRE).

I'll be investigating more about your issue.

Miguel.

0 Kudos