As the subject title suggests, I am trying to get a UART on the iMX93 to work in RS-485 mode. I am using YOCTO SCARTHGAP with Linux 6.6.36.
From my device tree:
&lpuart2 { /* MODBUS1 */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2>;
rts-gpios = <&gpio3 25 GPIO_ACTIVE_HIGH>; /* TXEn */
status = "okay";
};
pinctrl_uart2: uart2grp {
fsl,pins = <
MX93_PAD_UART2_TXD__LPUART2_TX 0x031E
MX93_PAD_UART2_RXD__LPUART2_RX 0x131E
MX93_PAD_SD3_DATA3__GPIO3_IO25 0x051E /* TXEn */
>;
};
With the logic analyzer connected to RX/TX/RTS I can see that RTS never toggles, just stays low. If I do a TX, I would expect RTS to go high and the TX data contained within the time before it goes back low. I can see the TX data on the analyzer, but RTS does nothing.
I can toggle RTS (GPIO3_IO25) from the command line with gpioset so there doesn't appear to be an electrical problem.
Help please!