AnsweredAssumed Answered

i.MX6UL RS485 Linux driver

Question asked by Adam Rudziński on Sep 8, 2018
Latest reply on Sep 10, 2018 by Adam Rudziński

Hello,

 

I have an i.MX6UL design in which I have an RS485 transceiver connected to the processor. The RS485 bus is supposed to be handled by UART5, ie. /dev/ttymxc4 in Linux. The "driver enable" line of the transceiver is connected to CTS_B output, ie. the same pin as GPIO1_09.

 

Is there any version of the SERIAL_IMX driver (drivers/tty/serial/imx.c) known to correctly control the driver enable line? If someone has a working setup of this kind, please, let me know what system version is used.

 

In my design, no matter what I try, the driver enable signal is brought high on boot and it stays this way. I've tried kernels 4.9, 4.12 and 4.14 with their version of the driver.

 

I have spent some time digging in the driver, and in theory that should work correctly. I have added printk's to see when the driver initializes RS485, and attempts to bring driver enable signal high or low, and these debugs appear at correct moments. The driver tries to write values which make sense to the UART's control register 2, but the signal doesn't change.

 

Also, I have noticed that if the transmitting process gets killed, no debug message (generated by one of my added printk's) related to bringing the driver enable to inactive state (low) appears. Maybe this is the matter of just a not displaying the debug message, but it can be also a bug.

 

Best regards,
Adam

Outcomes