Imx8mp UART garbled code

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

Imx8mp UART garbled code

635 Views
864535720
Contributor II

Hello, my hardware is an imx8mp evk board, and the Linux kernel is Linux version 5.15.71.
My problem is that when I am using the imx8mp evk development board, I found that UART encounters garbled characters when receiving data. For example, my imx8mp evk board is connected to the PC through UART1. My PC sent 0x0d data to the imx8mp evk board, but the data received by the imx8mp evk board was 0x0a
My testing method is as follows:
1. Execute command: stty - F/dev/ttymxc0 ispeed 115200 ospeed 115200 cs8
2. Execute command: cat/dev/ttymxc0>/rev.log
3. PC sends 0x0d to the board
4. The hexdump/rev.rog file shows that 0x0a was received

But if I am sending a string, such as hello world. The board can receive the correct data again.

My UART 1 device tree configuration is:
&uart1 { /* BT */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
assigned-clocks = <&clk IMX8MP_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
status = "okay";
};

pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX 0x140
MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX 0x140
>;
};

 

你好,我的硬件是imx8mp-evk板子,Linux内核是Linux version 5.15.71 。
我的问题是:我在使用imx8mp-evk开发板的时候,我发现uart在接收数据的时候,会出现乱码。比如我的imx8mp-evk板子和PC端通过UART1连接。我PC给imx8mp-evk板子发送0x0d的数据,但是imx8mp-evk板子收到的数据却是0x0a.
我的测试方式如下:
1、执行命令:stty -F /dev/ttymxc0 ispeed 115200 ospeed 115200 cs8
2、执行命令:cat /dev/ttymxc0 > /rev.log
3、PC端给板子发送0x0d
4、hexdump /rev.log文件,里面显示收到的是0x0a
 
但是如果我发送的是字符串,比如hello world。板子又能收到正确的数据。
 
我的uart1设备树配置是:
&uart1 { /* BT */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
assigned-clocks = <&clk IMX8MP_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
status = "okay";
};
 
pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX 0x140
MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX 0x140
>;
};
 

 

0 Kudos
Reply
1 Reply

588 Views
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @864535720 

Are you still having this issue?

I tried to replicate by my side but unsuccessfully, is there any other step that I am missing?

Are you using the pre-compiled image or did you compile the BSP with Yocto?

 

Best regards,

Salas.

0 Kudos
Reply