cancel
Showing results for 
Search instead for 
Did you mean: 

UART baudrate on STM32

Ted NIVAN
Associate II
Posted on March 27, 2018 at 19:33

Hi there,

Is it possible to change the uart baudrate dynamically after it has been initialized?

Kind regards,

#uart #stm32
3 REPLIES 3
Posted on March 27, 2018 at 19:37

Yes, but you want to make sure you've finished sending anything that is currently going over the wire before doing so.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Ted NIVAN
Associate II
Posted on March 27, 2018 at 20:12

Thanks for replying. Which function should I use in the HAL inside my main program?

Posted on March 27, 2018 at 20:38

On the STM32F7 I'd use something like this..

USART6->CR1 &= ~USART_CR1_UE;

USART6->BRR = APB2Clock / Baud;

USART6->CR1 |= USART_CR1_UE;
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..