Closed nishithvpoojary closed 1 year ago
For the HL core, you should call UART_Open
with a UART_Config
configuration struct. The configuration struct should be initialized using UART_InitConfig
. After initialization, you can then set the baudRate
member of the configuration struct to your desired baud rate before passing the struct to UART_Open
.
See an example here: https://github.com/Azure/azure-sphere-samples/blob/42d2d155400c92eb825d4a1e3d9c629ea2906186/Samples/DeviceToCloud/ExternalMcuLowPower/AzureSphere_HighLevelApp/uart_transport.c#L126
Thank you for your reply @jamesadevine . I have already set the UART config and opened the UART. Now I want to change the baud rate. Is it possible to change it later? Thank you.
If you are experienced with low-level Linux calls, you should be able to modify the baud rate using termios. Here is an example
An alternative is that you should close
the file descriptor and call UART_Open
with your revised config!
Hi. Thank you @jamesadevine and sorry for late reply. How can I close it. Only UART open is available in UART configuration settings.
@nishithpoojary just call close(fd);
on the file descriptor returned by UART_Open
!
@nishithpoojary just call
close(fd);
on the file descriptor returned byUART_Open
!
It is working. Thank you @jamesadevine
I can't find any option to close this issue?
I'll do the honours then 😄
Hi. I have set the Uart baud rate in the azure starter kit as 460800. How can I change it to 115200. Does the UART library have function to change baud rate in the code. Thank you.