Re: imx: RS-485 problems during TX, maybe DMA related

From: Fabio Estevam
Date: Fri Jan 06 2017 - 19:31:31 EST


Hi Clemens,

On Fri, Jan 6, 2017 at 8:50 PM, Clemens Gruber
<clemens.gruber@xxxxxxxxxxxx> wrote:

> But according to the i.MX Pins tool, they can be muxed vice-versa too.
> So if you connected the transceiver-enable to ball L4 (CSI0_DAT16), you
> could mux MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B and
> MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B instead?

Yes, I have tried like this:

&uart4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart4>;
uart-has-rtscts;
status = "okay";
};

pinctrl_uart4: uart4grp {
fsl,pins = <
MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA 0x1b0b1
MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B 0x1b0b1
>;
};

In this case the DE pin of the rs485 transceiver is always at 0 then
RX works and TX does not.

Then I tried to use a gpio for controling the rts line:

&uart4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart4>;
rts-gpios = <&gpio6 2 GPIO_ACTIVE_HIGH>;
status = "okay";
};

pinctrl_uart4: uart4grp {
fsl,pins = <
MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA 0x1b0b1
MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
MX6QDL_PAD_CSI0_DAT16__GPIO6_IO02 0x1b0b1
>;
}

In this case the DE pin of the rs485 transceiver is always at 1, then
TX works and RX does not.

So I was never able to observe the DE pin toggling correctly.

Maybe you could share your userspace application with me offline?

Thanks