i.MX53 UART DMA problem under WEC7/WEC2013

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

i.MX53 UART DMA problem under WEC7/WEC2013

Jump to solution
2,218 Views
rubenb
Contributor II

I have observed a strange behaviour for the UART in case of DMA mode (BSP_SDMA_SUPPORT_UARTx TRUE).

When we use ReadFile() to receive some kind of data, we always get back what we send out, except we send 16 Bytes (or  n x 16bytes) in a chunk

In this case ReadeFile() do not return the data unitl I add one ore more extra bytes , then I get the complete telegram packet back.

In case of NON-DMA mode all works fine, so before starting to dig deep into the UART FIFO / DMA handling, has anybody the same problem and a fix for that ?

This happend under WEC2013 and WEC7. I read some stuff at i.MX28 Windows CE BSP Serial Port Bug Missing Received Data , but not sure if it's the same issue.

Any tips are welcome !

Labels (1)
Tags (3)
0 Kudos
1 Solution
1,273 Views
rubenb
Contributor II

To anser my own question,

I added the Freescale SDMA script fix from the Linux repo : linux-2.6-imx.git - Freescale i.MX Linux Tree

ENGR40066538-1 MX53: UART: update the DMA script for UART ,  "When enable the DMA for UART, the ATDMAEN(cr1) does not works.

This fixed my problem here

View solution in original post

0 Kudos
8 Replies
1,274 Views
rubenb
Contributor II

To anser my own question,

I added the Freescale SDMA script fix from the Linux repo : linux-2.6-imx.git - Freescale i.MX Linux Tree

ENGR40066538-1 MX53: UART: update the DMA script for UART ,  "When enable the DMA for UART, the ATDMAEN(cr1) does not works.

This fixed my problem here

0 Kudos
1,273 Views
SergioSolis
NXP Employee
NXP Employee

Glad you found it.

Did you have problems finding the fix?, probably we should have it more visible.

0 Kudos
1,273 Views
rubenb
Contributor II

It's pure luck that this work for me, the ENGR40066538-1 is not public documented....

0 Kudos
1,273 Views
saurabh206
Senior Contributor III

Hi,

Ruben

Is it possible to provide patch for WEC?

0 Kudos
1,273 Views
fb2
Contributor I

Hi,

this is the patch we created for WEC 7 based on the Linux patch mentioned by Ruben.

Regards

Frank

0 Kudos
1,273 Views
saurabh206
Senior Contributor III

Hi,

FB

Thanks for patch.

Saurabh

0 Kudos
1,273 Views
markwilliams
Senior Contributor I

Hi,

I have been battling similar problems with the i.MX28 Serial Receive Hanlder under DMA. In my investigation I have found that the same problem exists for the i.MX51 and 53. You will find two main issues:

1) The UART will lose data when the circular buffer wraps around

2) The DMA chain is not set to continuously toggle between buffers which means while extracting data from the second buffer the UART cannot be receiving into the first buffer

I have a thread on the i.MX28 but the driver source is the same for the mdd and pdd part of the serial driver. Ignore the early posts as I move around a bit trying to find the problem which is summarised towards the end:

i.MX28 Windows CE BSP Serial Port Bug Missing Received Data

Mark

1,273 Views
rubenb
Contributor II

Thanks Mark,


I look what comes up in your thread, but does my problem have really the same root cause ?

Because we do not observe a loose of data, just that effect that when I send 16 Byte of data the ReadFile() didn't report them back unitl I send an extra Byte (or more), all data are buffered until that extra byte comes in.

0 Kudos