STM32L4S5ZIT: USART1,2,3 BRR(Baud Rate) configuration is not changing dynamically
STM32L4S5ZIT: My code is dynamically changing the AHB prescaler 1 or 2. I am using HSE external 6 MHZ crystal oscillator. So my program dynamically 6 to 3 & 3 to 6 MHZ will be changed through AHB prescaler(I am not using more than 2 prescaler). I am using the 1,2,3 USARTs for serial communications. Whenever i change the system frequency i will reconfigure the USART's BRR value to maintain the 4800 baud rate.
Problem scenario: First time, When i am in 6MHZ i configure the USART for 2400 baud rate 8bit, 2 stop bit & no parity configurations. I am using oversampling 16. In this case the USART is working as expected baudrate.
But when i change the system frequency to 3MHZ, if i reconfigure the USART based on 3MHZ, the USART is not working as expected baud rate of 2400. I can see in debugger the BRR value changed according to baud rate & System frequency. In this case the usart working on 4800 baud rate instead of 2400.
Do you know the reason for this scenario?