imx8 uart driver rs485 logic support

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

imx8 uart driver rs485 logic support

3,490 Views
yang_wang-wy
Contributor III

Hi Sir,

Currently, I am working on the IMX8dxp processor, but I meet some problems in linux driver of fsl-lpuart.c.

On my hardware we want to use an hardware rs485 transceiver to connect with our uart0 port and use another gpio to control the flow. 

And now the transceiver's tx and tx connect the tx and rx of UART0

The RE of transveiver connect the uart0_de[SPI0_CS0], it is not the general of cts or rts pin of uart.

So you could see the schematic from the attachment.

I want to confirm if our driver could support this rs485 logic.

I modified the dts but not working. the flow conftol pin was not controlled.

dts file

pinctrl_lpuart0: lpuart0grp {
fsl,pins = <
SC_P_UART0_TX_ADMA_UART0_TX 0x00000061
SC_P_UART0_RX_ADMA_UART0_RX 0x00000060
SC_P_SPI0_CS0_LSIO_GPIO1_IO08 0x20000061
>;
};

/*LPUART0 used for FMS RS485*/
&lpuart0 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpuart0>;
linux,rs485-enabled-at-boot-time;
status = "okay";
};

 

 

 
0 Kudos
4 Replies

1,376 Views
keyurthumar
Contributor I

Does rs485 support available for uart3 and uart6 on imx6ull ?

0 Kudos

3,484 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello yang_wang-wy ,

The UART in i.MX8 is LPUART. If you want to use software to control the direction of RS485 receiving and sending data, you need to use the RTS_B signal. However, lpuart driver does not support RS485 mode. If you need to use it, you need to add RS485 function yourself.
In addition, the hardware can also realize the automatic data receiving and sending of RS485. See below, please!

RS485.png

Have a nice day!

B.R,

Weidong

 

 

 

 

0 Kudos

3,413 Views
okwaj
Contributor III

Is it possible to make it work on imx6ul ? 

0 Kudos

3,473 Views
yang_wang-wy
Contributor III

Hi Weidong,

Thanks for your replay.
I also have an question about the schematic demo circuit.
I want to know if your demo circuit could support all bitrate of uart or I need to customize the circuit for different bitrate?
Currently, I need to support the following bitrate

B115200, B38400, B19200, B9600, B4800, B2400, B1200

BR

Yang Wang

0 Kudos