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
Hi Wei
one can check if dte or dce mode used, please check
Table 86. UART I/O Configuration vs. Mode i.MX6DQ Datasheet
http://www.nxp.com/docs/en/data-sheet/IMX6DQCEC.pdf
and check signal on i.mx uart rx pad with oscilloscope.
Also may be useful to check i.mx uart module register settings with jtag.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Many thanks for your help. The issue was resolved for the connector we use is not for 485 but 232. :smileysad: