imx93 | setting LPUART baudrate

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

imx93 | setting LPUART baudrate

1,866 Views
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 Kudos
Reply
8 Replies

1,842 Views
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 Kudos
Reply

1,822 Views
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 Kudos
Reply

1,806 Views
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 Kudos
Reply

1,814 Views
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 Kudos
Reply

1,812 Views
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 Kudos
Reply

1,801 Views
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 Kudos
Reply

1,796 Views
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 Kudos
Reply

1,614 Views
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 Kudos
Reply