Hello,
I am using IMX6ULL in uart 2 i was trying to configure RS-485 with gpio as enable pin but i am unable to do so please help me in this its urgent.
Here are the changes i made:
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2>;
rts-gpios = <&gpio4 25 GPIO_ACTIVE_HIGH>;
rs485-rts-delay = <0 0>;
status = "okay";
fsl,dte-mode;
};
pinctrl_uart2: uart2grp {
fsl,pins = <
MX6UL_PAD_UART2_TX_DATA__UART2_DTE_RX 0x1b0b1 /* SODIMM 36 */
MX6UL_PAD_UART2_RX_DATA__UART2_DTE_TX 0x1b0b1 /* SODIMM 38 */
MX6UL_PAD_CSI_DATA04__GPIO4_IO25 0x10b0
>;
};
&uart2 {
status = "okay";
rs485-rts-active-high;
linux,rs485-enabled-at-boot-time;
};
Prial Joshi
Hello @Prial_03
One can check the rs485.yaml.
You can try with rs485-rts-active-high as explained there.
Best regards,
Salas.
Hello @Alejandro_Salas
Have a look on 3rd part of DTSI configuration changes, i already did this but m not getting required results.
Regards,
Prial Joshi
Hello
Also you can refer to this example:
Best regards,
Salas.
hello @Alejandro_Salas ,
i tried as u said but by this UART was disabled and it is not present in /dev/ dir.
have a look on my configurations:
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2>;
status = "okay";
rts-gpios = <&gpio4 25 GPIO_ACTIVE_HIGH>; // GPIO4 pin 25 as RTS signal
rs485-rts-delay = <0 0>; // Delay before and after sending data
rs485-term-gpios = <&gpio4 25 GPIO_ACTIVE_HIGH>; // Use GPIO4 pin 25 as RS485 enable pin
fsl,dte-mode;
};
pinctrl_uart2: uart2grp {
fsl,pins = <
MX6UL_PAD_UART2_TX_DATA__UART2_DTE_RX 0x1b0b1 /* SODIMM 36 */
MX6UL_PAD_UART2_RX_DATA__UART2_DTE_TX 0x1b0b1 /* SODIMM 38 */
MX6UL_PAD_CSI_DATA04__GPIO4_IO25 0x10b0
//MX6UL_PAD_UART2_CTS_B__UART2_DTE_RTS 0x1b0b1 /* SODIMM 32 */
//MX6UL_PAD_UART2_RTS_B__UART2_DTE_CTS 0x1b0b1 /* SODIMM 34 */
>;
};
&uart2 {
status = "okay";
rs485-rts-active-high;
linux,rs485-enabled-at-boot-time;
};