imx93 | setting LPUART baudrate

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

imx93 | setting LPUART baudrate

1,867 次查看
sbmd_1234
Contributor III

Hi,

I have configured the LPUART2 configuration in the dts file and I am also getting the ttyLP1 file created successfully, but I want to change its baud rate.

It is currently set to BR 9600 but I want to change it to 115200 how can I do this? 

LOGS:
root@imx93-11x11-lpddr4x-evk:~# stty -F /dev/ttyLP1
speed 9600 baud; line = 0;
-brkint -imaxbel



Thanks.

0 项奖励
回复
8 回复数

1,843 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @sbmd_1234!
Thank you for contacting NXP Support!

 

You can use the next command to set the baudrate to 115200:

 

stty -F /dev/ttyLP1 115200

 

Best Regards!

Chavira

0 项奖励
回复

1,823 次查看
sbmd_1234
Contributor III

Hi @Chavira,

I don't want to do it manually using any user space command I want to configure it as by default baud rate. After boot, the baud rate should be 115200.


Thanks.

0 项奖励
回复

1,807 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @sbmd_1234!

 

I will be go deeper into it, the configuration can be done in device tree.

 

The fastest solution for this problem can be solved creating a service.

 

Create the service:

nano /etc/systemd/system/LPUART_CONFIG.service

 

Save the next content in the file:

[Unit]
Description="LPUART CONFIG"
[Service]
ExecStart=stty -F /dev/ttyLP1 115200
[Install]
WantedBy=multi-user.target

 

Enable the script in the startup/boot sequence following the
command:

systemctl enable LPUART_CONFIG.service

 

and reboot.

 

After that every time the LPUART should be configured in the correct baudrate.

 

Best Regards!

Chavira

0 项奖励
回复

1,815 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @sbmd_1234!

 

Try adding the property current-speed = <115200>;  to your device tree.

If that doesn't work please let me know.

 

Best Regards!

Chavira

0 项奖励
回复

1,813 次查看
sbmd_1234
Contributor III

Hi,

Already tried adding this in dts but that didn't work. Please tell me any alternate solution for this.


Thanks.

0 项奖励
回复

1,802 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @sbmd_1234!

 

Follow the instructions that I provide.

 

I implemented the service and it works by my side.

 

 

0 项奖励
回复

1,797 次查看
sbmd_1234
Contributor III

Thanks for your support!

I will check by my side also and let you know.

meanwhile please let me know if this could be done through the device tree file also.


0 项奖励
回复

1,615 次查看
sbmd_1234
Contributor III

Hi

Thanks the service worked for me.

If It is also possible to change the baudrate from device tree then please let me know.

Thanks for your support!!

0 项奖励
回复