iMX6Q with RS485


Our board is using an Apalis iMX6Q chip and we desire to use the RS485 hardware. I have enabled device tree such as…

		serial@021e8000 {
			compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
			reg = <0x21e8000 0x4000>;
			interrupts = <0x0 0x1b 0x4>;
			clocks = <0x2 0xa0 0x2 0xa1>;
			clock-names = "ipg", "per";
			dmas = <0x5 0x1b 0x4 0x0 0x5 0x1c 0x4 0x0>;
			dma-names = "rx", "tx";
			status = "okay";
			pinctrl-names = "default";
			pinctrl-0 = <0x48>;

Basically, this is one of two (known to me) ways of enabling the driver to use RS485 within the driver. Another way is to do it in my Qt user app as such…

/* Enable RS485 mode: */
structRS485Conf.flags |= SER_RS485_ENABLED;

/* Set logical level for RTS pin equal to 1 when sending: */
//structRS485Conf.flags |= SER_RS485_RTS_ON_SEND;
/* or, set logical level for RTS pin equal to 0 when sending: */
structRS485Conf.flags &= ~(SER_RS485_RTS_ON_SEND);

/* Set logical level for RTS pin equal to 1 after sending: */
//structRS485Conf.flags |= SER_RS485_RTS_AFTER_SEND;
/* or, set logical level for RTS pin equal to 0 after sending: */
//structRS485Conf.flags &= ~(SER_RS485_RTS_AFTER_SEND);

/* Set rts delay before send, if needed: */
structRS485Conf.delay_rts_before_send = 0;

/* Set rts delay after send, if needed: */
structRS485Conf.delay_rts_after_send = 0;

/* Set this flag if you want to receive data even whilst sending data */
//structRS485Conf.flags |= SER_RS485_RX_DURING_TX;

if ( ioctl ( m_fdTtymxc1, TIOCSRS485, &structRS485Conf ) < 0 )
    int nMyErrno = errno;
    /* Error handling. See errno. */
    emit error ( tr ( "Can't open ttymxc1, errno %1" ).arg ( nMyErrno ) );

I get an errno of 25 which states that the device is not a typewriter. Yay! I have seen another post on here that shows someone has created a patch using the device tree to make this work on a dts file for vf-colibri-eval (/arch/arm/boot/dts/vf-colibri-eval-v3.dtsi). As this deals with adjusting the pins, I am a bit hesitant to delve into this, but am going to anyways to attempt to keep moving forward.

What I am wondering is if anyone out there has gotten the Apalis-iMX6 RS485 hardware to work? And if so, can you assist me by letting me know the tasks you performed to make it happen? I may have subsequent questions. Thank you in advance!!!

Enjoy your day.


It turns out that RS485 is not supported in the 3.14.28 serial driver “drivers/tty/serial/imx.c”. So now I seem to be in need of patching the kernel.

Another question may be for Toradex and see if there is a future plan to support RS485 in 3.14.28?


No, we no longer support 3.14.28 and there are no future plans to support any older BSP beta versions.