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 !
Solved! Go to Solution.
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
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
Glad you found it.
Did you have problems finding the fix?, probably we should have it more visible.
It's pure luck that this work for me, the ENGR40066538-1 is not public documented....
Hi,
Ruben
Is it possible to provide patch for WEC?
Hi,
FB
Thanks for patch.
Saurabh
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
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.