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.
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
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.
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
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
Hi,
Already tried adding this in dts but that didn't work. Please tell me any alternate solution for this.
Thanks.
Hi @sbmd_1234!
Follow the instructions that I provide.
I implemented the service and it works by my side.
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.
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!!