RS-485 confifgure in UART-2 IMX6ULL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RS-485 confifgure in UART-2 IMX6ULL

412 Views
Prial_03
Contributor II

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 

0 Kudos
Reply
4 Replies

388 Views
Alejandro_Salas
NXP TechSupport
NXP TechSupport

Hello @Prial_03 

 

One can check the rs485.yaml.

You can try with rs485-rts-active-high as explained there.

 

Best regards,

Salas.

0 Kudos
Reply

379 Views
Prial_03
Contributor II

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

0 Kudos
Reply

363 Views
Alejandro_Salas
NXP TechSupport
NXP TechSupport

Hello

 

Also you can refer to this example:

https://github.com/boundarydevices/linux/blob/boundary-imx_4.14.x_2.0.0_ga/arch/arm/boot/dts/imx6ull...

 

Best regards,

Salas.

0 Kudos
Reply

292 Views
Prial_03
Contributor II

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;
};

0 Kudos
Reply