I'm currently working on utilizing UART4 on our custom i.MX8M Mini board running Android 11 and Linux Kernel 5.10.72.
I've incorporated the necessary Device Tree Source (DTS) changes for UART4 and attempted a loopback test.
DTS changes:
pinctrl_uart4: uart4grp {
fsl,pins = <
MX8MMN(IOMUXC_UART4_RXD_UART4_DCE_RX, 0x140)
MX8MMN(IOMUXC_UART4_TXD_UART4_DCE_TX, 0x140)
>;
};
&uart4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart4>;
assigned-clocks = <&clk IMX8MMN(CLK_UART4)>;
assigned-clock-parents = <&clk IMX8MMN(SYS_PLL1_80M)>;
status = "okay";
};
I'm encountering an issue where the output of the loop back test results in receiving the same sent data continuously.
iMX8MMINI
Hi @Sushmamp!
Thank you for contacting NXP Support!
To use the UART4 on iMX8MM you have to modify the bl31_setup.c too.
Please check the guide below:
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/How-to-use-UART4-on-iMX8M-from-Linux-Use...
Best Regards!
Chavira
Hi @Chavira
Thank you for your reply.
We already modified the imx8mn_bl31_setup.c file to support for UART4.
imx8mn_bl31_setup.c
/* peripherals domain permission */
#if 0
- RDC_PDAPn(RDC_PDAP_UART4, D1R | D1W),
+ RDC_PDAPn(RDC_PDAP_UART4, D0R | D0W),
RDC_PDAPn(RDC_PDAP_UART2, D0R | D0W),
RDC_PDAPn(RDC_PDAP_UART1, D0R | D0W),
Hi @Sushmamp!
Do you modify Line 64 or line 111?
For your purpose, you have to change line 64 because is the Android Build, and line 111 is for the Linux Build.
Best Regards!
Chavira
Hi @Chavira
In our android build we have that line in only 1 place at line 62.
And one more thing to add on is we are trying to connect to barcode scanner to that UART4 interface.
we are not abel to read the data received on UART4(/dev/ttymxc3) from an UART barcode scanner and baudrate of the UART4 and barcode scanner is set to 115200.
We verified same barcode scanner with UART3 we are able to read the data from barcode scanner.
Hi @Sushmamp!
How are you running your loopback test?
I am assuming an echo is being sent to the serial device with a similar command:
echo "hello" > /dev/ttySx
Where ttySx would be the serial device you are testing in loopback.
I would try disabling the echo and onlcr options from your serial device.
Use the following command to check if the previous options are enabled in your serial device:
stty -a -F /dev/ttySx
If said options are present, disable them with the following line:
stty -F /dev/ttySx -echo -onlcr
Hope this does the trick.