RS485 9-bit mode with DMA

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

RS485 9-bit mode with DMA

1,327 Views
abelal
Contributor III

Hi,

We are trying to implement RS485 9-bit mode as discussed in IMX6SDLRM (Rev. 1, 04/2013). We have a RS485 transceiver connected to the uart5 of the board and things seem to work okay in normal transfers. However, when we try to switch to DMA mode, the controller seems to drop the address byte although a Slave Address Detected interrupt is raised. We are using a 3.10.45 kernel based on the 3.10.17 kernels from the Freescale GA branch  git://git.freescale.com/imx/linux-2.6-imx.git branch imx_3.10.17_1.0.0_ga as well as Boundary Devices GA merge branch github.com:boundarydevices/linux-imx6.git branch boundary-imx_3.10.17_1.0.0_ga-merge.

The programming sequence is as follows:

Enable RS485 9-bit mode:

ucr2 |= (UCR2_IRTS | UCR2_PREN | UCR2_WS);

ucr2 &= ~(UCR2_CTS | UCR2_CTSC);

umcr |= UMCR_MDEN | UMCR_SLAM | UMCR_SADEN;

Send data using DMA:

umcr |= TXB8;

transmit address byte using normal transfer, make sure the byte is transmitted before moving forward.

umcr &= ~TXB8;

write data using DMA

Data reception:

No changes

imx_int:

if (sts & USR1_SAD)

    writel(USR1_SAD, sport->port.membase + USR1);

Hope I've provided enough information, kindly let me know if any more details are required.

Labels (2)
0 Kudos
Reply
1 Reply

727 Views
igorpadykov
NXP Employee
NXP Employee

Hi Awais

for narrow down possible reasons and remove OS-side effects

of this behaviour it may be recommended to reproduce it with SDK

i.MX 6Series Platform SDK : Bare-metal SDK

Best regards

igor

0 Kudos
Reply