Receiving junk data while running rs485 send and receive application on imx6dl

cancel
Showing results for 
Search instead for 
Did you mean: 

Receiving junk data while running rs485 send and receive application on imx6dl

Jump to solution
188 Views
Contributor V

I'm using an imx6dl board with Android BSP. 

I'm running a custom application on the board where I configure my Linux PC as a sender and the board a receiver.

The PC transmits * Bytes of data at 38400 Baudrate and the board is supposed to capture this data print the value received and send it back to the PC.

The PC then echos the data received from the board. We expect to see the same bytes being received from the board,

however we get a large burst of noise at times on the sender side (PC).

Here is the log:

Sender:


> B7 02 00 00 00 00 00 00
< B7 02 00 00 00 00 00 00

> B8 02 00 00 00 00 00 00
< B8 02 00 00 00 00 00 00

> B9 02 00 00 00 00 00 00
< B9 02 00 00 00 00 00 00

> BA 02 00 00 00 00 00 00

< BA 02 BA 02 00 00 00 00 00 00 00 00 00 00 00 00 BC 00 00 00 00 00 00 00 BD 00 00 00 00

> BB 02 00 00 00 00 00 00
< 00 00 00 BE 00 00 00 00 00 00 00 BF 00 00 00 00 00 00 00 C0 00 00 00 00 00 00 00 C1 00 00 00 00 00 00 00 C2 00 00 00 00 00 00 00 C3 00 00 00 00 00 00 00 C4 00 00 00 00 00 00 00 C5 00 00 00 00 00 00 00 C6 00 00 00 00 00 00 00 C7 00 00 00 00 00 00 00 C8 00 00 00 00 00 00 00 C9 00 00 00 00 00 00 00 CA 00 00 00 00 00 00 00 CB 00 00 FF 40 80 80 00 00 CD 00 00 00 00 00 00 00 CE 00 00 00 00 00 00 00 CF 00 00 00 00 00 00 00 D0 00 00 00 00 00 00 00 D1 00 00 00 00 00 00 00 D2 00 00 00 00 00 00 00 D3 00 00 00 00 00 00 00 D4 00 00 00 00 00 00 00 D5 00 00 00 00 00 00 00 D6 00 00 00 00 00 00 00 D7 00 00 00 00 00 00 00 D8 00 00 00 00 00 00 00 D9 00 00 00 00 00 00 00 DA 00 00 00 00 00 00 00 DB 00 00

> BC 02 00 00 00 00 00 00
< 00 00 00 00 00 DC 00 00 00 00 00 00 00 DD 00 00 00 00 00 00 00 DE 00 00 00 00 00 00 00 DF 00 00 00 00 00 00 00 E0 00 00 00 00 00 00 00 E1 00 00 00 00 00 00 00 E2 00 00 00 00 00 00 00 E3 00 00 00 00 00 FC 10 A0 1E 20 20 40 40 80 80 00 E6 00 00 00 00 00 00 00 E7 00 00 00 00 00 00 00 E8 00 00 00 00 00 00 00 E9 00 00 00 00 00 00 00 EA 00 00 00 00 00 00 00 EB 00 00 00 00 00 00 00 EC

> BD 02 00 00 00 00 00 00
< 00 00 00 00 00 00 00 ED 00 00 00 00 00 00 00 EE 00 00 00 00 00 00 00 EF 00 00 00 00 00 00 00 F0 00 00 00 00 00 00 00 F1 00 00 00 00 00 00 00 F2 00 00 00 00 00 00 00 F3 00 00 00 00 00 00 E0 AA 00 00 00 00 00 00 00 F6 00 00 00 00 00 00 00 F7 00 00 00 00 00 00 00 F8 00 00 00 00 00 00 00 F9 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00

> BE 02 00 00 00 00 00 00
< FB 00 00 00 00 00 00 00 FC 00 00 00 00 00 00 00 FD 00 00 00 00 00 00 00 FE 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 01 01 00 00 00 00 00 00 02 01 00 00 00 00 00 00 03 01 00 00 00 00 00 00 04 01 00 00 00 00 00 00 05 01 00 00 00 00 00 00 06 01 00 00 00 00 00 00 07 01 00 00 00 00 00 00 08 01 00 00 00 00 00 00 09 01 00 00 00 00 00 FC D0 A1 20 40 40 80 80 00 00 0C 01 00 00 00 00 00 00 0D 01 00 00 00 00 00 00 0E 01 00 00 00 00 00 00 0F 01 00 00 00 00 00 00 10 01 00 00 00 00 00 00 11 01 00 00 00 00 00 00 12 01 00 00

> BF 02 00 00 00 00 00 00
< 00 00 00 00 13 01 00 00 00 00 00 00 14 01 00 00 00 00 00 00 15 01 00 00 00 00 00 00 16 01 00 00 00 00 00 00 17 01 00 00 00 00 00 00 18 01 00 00 00 00 00 00 19 01 00 00 00 00 00 00 1A 01 00 00 00 00 00 00 1B 01 00 00 00 00 00 00 1C 01 00 00 00 00 00 00 1D 01 00 00 00 00 00 00 1E 01 00 00 00 00 00 00 1F 01 00 00 00 FE 20 20 40 48 40 80 80 00 00 00 00 22 01 00 00 00 00 00 00 23 01 00 00 00 00 00 00 24 01 00 00 00 00 00 00 25 01 00 00 00 00 00 00 26 01 00 00 00 00 00 00 27 01 00 00 00 00 00 00 28 01 00 00 00 00 00 00 29 01 00 00 00 00 00 00 2A 01 00 00 00 00 00 00 2B 01 00 00 00 00 00 00 2C 01 00 00 00 00 00 00 2D 01 00 00 00 00 00 00 2E 01 00 00 00 00 00 00 2F 01 00 00 00 00

> C0 02 00 00 00 00 00 00
< 00 00 30 01 00 00 00 00 00 00 31 01 00 00 00 00 00 00 32 01 00 00 00 FC 10 20 20 4D 40 80 80 00 00 00 00 35 01 00 00 00 00 00 00 36 01 00 00 00 00 00 00 37 01 00 00 00 00 00 00 38 01 00 00 00 00 00 00 39 01 00 00 00 00 00 00 3A 01 00 00 00 00 00 00 3B 01 00 00 00 00 00 00 3C 01 00 00 00 00 00 00 3D 01 00 00 00 00 00 00 3E 01 00 00 00 00 00 00 3F 01 00 00 00 00 00 00 40 01 00 00 00 00 00 00 41 01 00 00 00 00 00 00 42 01 00 00 00 00 00 00

> C1 02 00 00 00 00 00 00
< 43 01 00 00 00 00 00 00 44 01 00 E0 02 02 04 04 C8 2A 10 10 20 20 40 40 80 54 20 20 40 40 80 80 00 48 01 00 00 00 00 00 00 49 01 00 00 00 00 00 00 4A 01 00 00 00 00 00 00 4B 01 00 00 00 00 00 00 4C 01 00 00 00 00 00 00 4D 01 00 00 00 00 00 00 4E 01 00 00 00 00 00 00 4F 01 00 00 00 00 00 00 50 01 00 00 00 00 00 00 51 01 00 00 00 00 00 00 52 01 00 00 00 00 00 00 53 01 00 00 00 00 00 00 54 01 00 00 00 00

> C2 02 00 00 00 00 00 00
< 00 00 55 01 00 00 00 00 00 00 56 01 00 00 00 00 00 00 57 01 00 00 00 00 00 00 58 01 00 00 FE 20 40 40 80 AD 01 00 00 00 00 00 00 5B 01 00 00 00 00 00 00 5C 01 00 00 00 00 00 00 5D 01 00 00 00 00 00 00 5E 01 00 00 00 00 00 00 5F 01 00 00 00 00 00 00 60 01 00 00 00 00 00 00 61 01 00 00 00 00 00 00 62 01 00 00 00 00 00 00 63 01 00 00 00 00 00 00 64 01 00 00 00 00 00 00 65 01 00 00 00 00 00 00 66 01 00 00 00 00 00 00 67 01 00 00 00 00 00 00 68 01 00 00 00 00 00

> C3 02 00 00 00 00 00 00
< 00 69 01 00 00 00 00 00 00 6A 01 00 00 00 00 00 00 6B 01 00 00 00 00 00 00 6C 01 00 00 00 00 00 00 6D 01 00 00 00 00 F8 08 E8 2B 10 10 20 20 40 40 80 B8 01 00 00 00 00 00 00 71 01 00 00 00 00 00 00 72 01 00 00 00 00 00 00 73 01 00 00 00 00 00 00 74 01 00 00 00 00 00 00 75 01 00 00 00 00 00 00 76 01

> C4 02 00 00 00 00 00 00
< 00 00 00 00 00 00 77 01 00 00 00 00 00 00 78 01 00 00 00 00 00 00 79 01 00 00 00 00 00 00 7A 01 00 00 00 00 00 00 7B 01 00 00 00 00 00 00 7C 01 00 00 00 00 00 00 7D 01 00 00 00 00 00 00 7E 01 00 00 00 00 00 00 7F 01 00 00 00 00 00 00 80 01 00 E0 02 02 04 04 48 2C 10 10 20 20 40 40 80 B0 40 40 80 80 00 00 00 84 01 00 00 00 00 00 00 85 01 00 00 00 00 00 00 86 01 00 00 00 00 00 00 87 01 00 00 00 00 00 00 88 01 00 00 00 00 00 00

> C5 02 00 00 00 00 00 00
< 89 01 00 00 00 00 00 00 8A 01 00 00 00 00 00 00 8B 01 00 00 00 00 00 00 8C 01 00 00 00 00 00 00 8D 01 00 00 00 00 00 00 8E 01 00 00 00 00 00 00 8F 01 00 00 00 00 00 00 90 01 00 00 00 00 00 00 91 01 00 00 00 00 00 00 92 01 00 00 00 00 00 00 93 01 00 00 00 00 00 00 94 01 00 00 00 00 00 00 95 01 00 00 FC 10 20 20 40 59 20 20 40 40 80 80 00 98 01 00 00 00 00 00 00 99 01 00 00 00 00 00 00 9A 01 00 00 00 00 00 00 9B 01 00 00 00 00 00 00 9C 01 00 00 00 00 00 00 9D 01 00 00 00 00 00 00 9E 01 00 00 00 00 00 00 9F 01 00 00 00 00 00 00 A0 01 00 00 00 00 00 00 A1 01 00 00 00 00 00 00 A2 01 00 00 00 00 00 00 A3 01 00 00 00 00 00 00 A4 01 00 00 00 00 00 00 A5 01 00 00 00 00

> D4 02 00 00 00 00 00 00
< D4 02 00 00 00 00 00 00

> D5 02 00 00 00 00 00 00
< D5 02 00 00 00 00 00 00

> D6 02 00 00 00 00 00 00
< D6 02 00 00 00 00 00 00

> D7 02 00 00 00 00 00 00
< D7 02 00 00 00 00 00 00

> D8 02 00 00 00 00 00 00
< D8 02 00 00 00 00 00 00

the > represents send and < represents received.

I applied this patch serial: imx: Prevent TX buffer PIO write when a DMA has been started · torvalds/linux@514ab34 · GitH... 

but it doesn't have any effect.

What might be causing this?

0 Kudos
1 Solution
11 Views
Contributor V
0 Kudos
5 Replies
12 Views
Contributor V
0 Kudos
11 Views
Contributor III

Hi Sujay,

RS-485 networks require termination and an idle state biasing network. At least simple receivers my not be "fault tolerant" and my receive noise when the other side is not sending (idle line).

Regards

Christian

0 Kudos
11 Views
Contributor V

Hi Christian,

Can you specify how to set up an idle state biasing network?

0 Kudos
11 Views
Contributor III
11 Views
NXP TechSupport
NXP TechSupport

Hi Sujay

one can try to disable dma, to check if it not caused by dma.

Re: [PATCH] serial: imx: disable DMA for RS-485 on i.MX6 SMP - Fabio Estevam 

serial: imx: half-duplex RS485 operation with RTS active low - Patchwork 

Also one can try with nxp linux from source.codeaurora.org/external/imx/linux-imx  repository
linux-imx - i.MX Linux kernel 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------