RS-485(Automatically)

RS485 half duplex can be frustrating. You have to eliminate as many variables as possible. I would:

  • test your system using a colibri dev board using rs485 mode. You can even use two dev boards and link them together using rs485. You’ll then be able to see if your other system is causing the trouble.

  • what is the PC side in your system? Is it a native rs485 interface or some sort of usb converter? Those things stink and can cause all kinds of trouble. Avoid them and just use rs232 if you have to use a pc (something full duplex).

  • if you have access to a scope, you should look at the incoming datastream along with the rts line on your linux side.

Yes I am using RS485 to USB converter at PC side.

Is there any need to enabling DMA for RS485?
If yes so how can I enable DMA for RS485?
Can you provide any reference code or link for this.

Hi @Mohd

DMA is already enabled in the devicetree(arch/arm/boot/dts/vfxxx.dtsi).Could you provide complete test code to reproduce the issue.

Hello @ashok.tx
Please find the attachment for code.
UART_RS485.txt (4.3 KB)
Also mention below main thread code for testing Read Write operation.
while(1)
{
memset(RecvBuff,0,sizeof(RecvBuff));
WriteToUart2(buff, sizeof(buff)); //Write call
usleep(1000000); //1000 mili seconds
ReadFromUart2(RecvBuff, sizeof(buff)); //Read Call
printf(“Response : %s\r\n”, RecvBuff);
memset(RecvBuff,0,1500);
}

Hello @ashok.tx

Any update ??