Hi Dear reader(s),
Is there a way to reconfigure a UART during run-time in firmware?
For example, run UART at 9600 baud for some time, then switch to 115200 baud without doing a hardware reset.
Thanks,
Kevin
Hello Kevin,
It is possible to reconfigure the UART during run-time. With the help of the lpuart driver provided within the SDK is really easy. You just need to call the function LPUART_DRV_Deinit() and the initialize again the module with the new baud rate that you want to configure. If you have the interrupts enabled, then you need to disable the UART interrupt too.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Victor,
Thank you for your reply!!
I am not using any SDK. Could I do this without any SDK?
Thanks,
Kevin
On Thu, Jul 4, 2019 at 4:27 PM victorjimenez <admin@community.nxp.com>
Hello Kevin,
Yes, it would be possible to achieve this without the SDK. However, you will have to make the bare-metal implementation of the function LPUART_DRV_Deinit since we don't provide it.
Best Regards,
Victor