AnsweredAssumed Answered

Strange problem while using UART with DMA

Question asked by Jarod Nan on Aug 12, 2014
Latest reply on Aug 13, 2014 by Jarod Nan

I've got a RSB4210(i.MX536) from Advantech and trying to use UART4 with DMA.

The bsp is from the manufacturer, and the kernel version is 2.36.35. Strange things appear if I enable the DMA of UART4.

Using printk to output some debuf message in the mxcuart_dmaread_callback() funtion of mxc_uart.c, I've got things below.

 

If I send 64 bytes to the RSB4210, mxcuart_dmaread_callback() is called 3 times, and the received data each time is:

1   bytes:  0x00

46 bytes: 45bytes 0x00

19 bytes: 19bytes

 

If I send 128 bytes to the RSB4210, mxcuart_dmaread_callback() is called 4 times, and the received data each time is:

1   bytes:  0x00

46 bytes: 45bytes 0x00

46 bytes: 45bytes 0x00

38 bytes: 38bytes

 

I've also merge the sdma_script_code_mx53.h, mxc_uart.c, mxc_uart.h, serial.c, serial.h from the freescale git server (http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_2.6.35_maintain). But it's still the same.

 

I've consult Advantech's engineers, they tell me that engineers from freescale said that it should be connected with 4 wires in DMA mode in order to avoid errors. I don't thing it has anything to do with the strange things.

Outcomes