AnsweredAssumed Answered

imx uart RS485 rx not working

Question asked by wei chen on Sep 5, 2018
Latest reply on Sep 5, 2018 by wei chen

Hi,

I'm working on the RS485, but the rx always couldnot work.

Hardware: imx6qsabresd

 

The dts is as:

&uart2 {
|   pinctrl-names = "default";
|   pinctrl-0=<&pinctrl_uart2>;
|   uart-has-rtscts;
|   linux,rs485-enabled-at-boot-time;
|   status = "okay";
};

 

|   |   pinctrl_uart2: uart2grp {
|   |   |   fsl,pins = <
|   |   |   |   MX6QDL_PAD_EIM_D26__UART2_TX_DATA|  0x1b0b1
|   |   |   |   MX6QDL_PAD_EIM_D27__UART2_RX_DATA|  0x1b0b1
|   |   |   |   MX6QDL_PAD_EIM_D28__UART2_CTS_B||   0x1b0b1
|   |   |   >;
|   |   };

 

I configure the rs485 flag as:

    struct serial_rs485 rs485conf;
    if (ioctl (pf, TIOCGRS485, &rs485conf) < 0) {
        printf("Error reading ioctl port");
    }

 

rs485conf.flags |= SER_RS485_ENABLED;

ioctl (pf, TIOCSRS485, &rs485conf);

 

When I use microcom to debug(I add a print at rts active/inactive), it could send out data but couldnot receive.

root@imx6qsabresd:~# microcom -s 115200 /dev/ttymxc1
imx-uart 21e8000.serial: imx_set_termios !!!!!
imx-uart 21e8000.serial: imx port rts active
imx-uart 21e8000.serial: imx_set_termios !!!!!
imx-uart 21e8000.serial: imx port rts active
imx-uart 21e8000.serial: imx rts inactive

 

Could you give a hand?

 

Thanks & Regards,

Wei

Outcomes