Hi,
I want to use one of the imx6 uarts in RS485 mode. Therefore i followed the instructions here. The RTS line goes low when sending and is high otherwise. Now i need to invert this line so that RTS is high when sending and low otherwise. I tried to change the devicetree by replacing rs485-rts-active-low with rs485-rts-active-high but this does not change the RTS behaviour. Even when i use ioctl commands (see code snippet) i am not able to invert the RTS line. Any help would be welcome.
struct serial_rs485 rs485conf;
/* Enable RS485 mode: */
rs485conf.flags |= SER_RS485_ENABLED;
/* Set logical level for RTS pin equal to 1 when sending: */
rs485conf.flags |= SER_RS485_RTS_ON_SEND;
/* or, set logical level for RTS pin equal to 0 after sending: */
rs485conf.flags &= ~(SER_RS485_RTS_AFTER_SEND);
/* Set this flag if you want to receive data even whilst sending data */
rs485conf.flags |= SER_RS485_RX_DURING_TX;
Hi,
I have installed the most recent demo image via TEZI and did some measurements using a Ixora carrier board. Please find my results and the test program attached. The “low active RTS” looks fine i guess (-6V means logic high). However the “high active RTS” looks odd. Can you confirm that this is the expected behavior?
Sorry for the delayed answer. I could reproduce the behaviour.
Actually when you set RTS active low, then the output on Ixora is high, since there is a Inverter integrated in the RS-232 Line Driver which is on the board.
Regarding your issue, you are right, the RTS is high only after setting up the IoCtl and some time after the transmission has finished, which is not what you want.
It seems this is a bug, as reported here. The solution seems to be use the mainline kernel driver, where you can use the RTS_Pin being any gpio. You need to check if this fits your requirements, since changing a GPIO through the driver (software) will take more time the hardware. In this case, the recommendation will be to add a inverter on your carrier board.