Hello, all,
I’m trying to use the Verdin i.MX8M-plus RS-485 interface. I faced an issues with the configuration of RTS/DE signal. The default configuration of UART1 supports rs485-rts-active-low. My board uses rs485-rts-active-high, since RS-485 transceiver requires a high-level to enable the transmitter.
I’ve placed the following code in my device tree file in order to set:
- pull down on RTS/DE pin;
- active-high RTS/DE;
&pinctrl_uart1 {
fsl,pins =
<MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX 0x1c4>, /* SODIMM 129 */
<MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX 0x1c4>, /* SODIMM 131 */
<MX8MP_IOMUXC_SAI2_TXFS__UART1_DCE_CTS 0x0c4>; /* SODIMM 133 */
};
&uart1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
linux,rs485-enabled-at-boot-time;
rs485-rts-active-high;
rs485-rx-during-tx;
};
The device tree file is compiled and loaded properly. Other functions, like LEDs and GPIOs works fine, but the behavior of RTS/DE is as active-low.
The SODIMM 133 is low in uboot. Once the kernel start to boot it becomes high and remains high. This is very sensitive situation for my device, because that means the RS-485 transmitter will be in enabled all of the time during boot and the RS-485 bus will be blocked, or worse - fake data will be transmitted.
When I execute the tests, described here:
the result is as for active low RTS/DE. The signal remains high and goes low for ~300us during transmission. After that goes to high again.
If I run minicom, the behavior of RTS/DE changes. The RTS/DE remains low. If RS-485 mode is enabled in minicom serial options, ports works as expected - RTS/DE becomes active high and I can establish bidirectional communication.
Once I quit minicom, RTS/DE switches to active-low behavior again and remains high.
Please provide some hints how to fix this.
With kind regards,
Ivan
Verdin iMX8M-plus QL 1GB IT, v1.1A
Custom Yocto build, BSP 7.5.0
Custom carrier board