i.MX93 UART RS-485 RTS does not toggle

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

i.MX93 UART RS-485 RTS does not toggle

Jump to solution
1,438 Views
davidpatton
Contributor III

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!
Labels (2)
Tags (1)
0 Kudos
Reply
1 Solution
1,350 Views
davidpatton
Contributor III
I was stuck in my old i.MX6 mode thinking imx.c was the UART driver, for the i.MX93 it's fsl_lpuart.c. Unfortunately fsl_lpuart.c is not nearly as flexible as imx.c and does not support "rts-gpios" which I will need to port from imx.c into fsl_lpuart.c for our board to work.

View solution in original post

0 Kudos
Reply
1 Reply
1,351 Views
davidpatton
Contributor III
I was stuck in my old i.MX6 mode thinking imx.c was the UART driver, for the i.MX93 it's fsl_lpuart.c. Unfortunately fsl_lpuart.c is not nearly as flexible as imx.c and does not support "rts-gpios" which I will need to port from imx.c into fsl_lpuart.c for our board to work.
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2259525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ei.MX93%20UART%20RS-485%20RTS%20does%20not%20toggle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2259525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAs%20the%20subject%20title%20suggests%2C%20I%20am%20trying%20to%20get%20a%20UART%20on%20the%20iMX93%20to%20work%20in%20RS-485%20mode.%20I%20am%20using%20YOCTO%20SCARTHGAP%20with%20Linux%206.6.36.%3C%2FP%3E%3CP%3EFrom%20my%20device%20tree%3A%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3E%26amp%3Blpuart2%3C%2FSPAN%3E%3CSPAN%3E%20%7B%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20MODBUS1%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Epinctrl-names%20%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22default%22%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Epinctrl-0%20%3D%20%26lt%3B%3C%2FSPAN%3E%3CSPAN%3E%26amp%3Bpinctrl_uart2%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Erts-gpios%20%3D%20%26lt%3B%3C%2FSPAN%3E%3CSPAN%3E%26amp%3Bgpio3%3C%2FSPAN%3E%20%3CSPAN%3E25%3C%2FSPAN%3E%20%3CSPAN%3EGPIO_ACTIVE_HIGH%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%3B%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20TXEn%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Estatus%20%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22okay%22%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3Epinctrl_uart2%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3Euart2grp%3C%2FSPAN%3E%3CSPAN%3E%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Efsl%2Cpins%20%3D%20%26lt%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EMX93_PAD_UART2_TXD__LPUART2_TX%3C%2FSPAN%3E%20%3CSPAN%3E0x031E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EMX93_PAD_UART2_RXD__LPUART2_RX%3C%2FSPAN%3E%20%3CSPAN%3E0x131E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EMX93_PAD_SD3_DATA3__GPIO3_IO25%3C%2FSPAN%3E%20%3CSPAN%3E0x051E%3C%2FSPAN%3E%20%3CSPAN%3E%2F*%20TXEn%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26gt%3B%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWith%20the%20logic%20analyzer%20connected%20to%20RX%2FTX%2FRTS%20I%20can%20see%20that%20RTS%20never%20toggles%2C%20just%20stays%20low.%20If%20I%20do%20a%20TX%2C%20I%20would%20expect%20RTS%20to%20go%20high%20and%20the%20TX%20data%20contained%20within%20the%20time%20before%20it%20goes%20back%20low.%20I%20can%20see%20the%20TX%20data%20on%20the%20analyzer%2C%20but%20RTS%20does%20nothing.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EI%20can%20toggle%20RTS%20(GPIO3_IO25)%20from%20the%20command%20line%20with%20gpioset%20so%20there%20doesn't%20appear%20to%20be%20an%20electrical%20problem.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EHelp%20please!%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2259525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EYocto%20Project%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2261444%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20i.MX93%20UART%20RS-485%20RTS%20does%20not%20toggle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2261444%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI%20was%20stuck%20in%20my%20old%20i.MX6%20mode%20thinking%20imx.c%20was%20the%20UART%20driver%2C%20for%20the%20i.MX93%20it's%20fsl_lpuart.c.%20Unfortunately%20fsl_lpuart.c%20is%20not%20nearly%20as%20flexible%20as%20imx.c%20and%20does%20not%20support%20%22rts-gpios%22%20which%20I%20will%20need%20to%20port%20from%20imx.c%20into%20fsl_lpuart.c%20for%20our%20board%20to%20work.%3C%2FLINGO-BODY%3E