drivers/serial: stm32: Force oversampling value
When setting baudrate register, baudrate value is computed according to the oversampling given value, which is default boot time value (16). In case oversampling value has been changed by bootloader (as in case of TFM bootloader), a desynchronsation happens between OVR and BRR values and the ouptut baudarate is incorrect. For oversampling register before setting the baudrate to avoid this situation. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
4b7a71962f
commit
37c7b89e43
1 changed files with 4 additions and 1 deletions
|
@ -75,7 +75,10 @@ static inline void uart_stm32_set_baudrate(const struct device *dev,
|
|||
baud_rate);
|
||||
} else {
|
||||
#endif /* HAS_LPUART_1 */
|
||||
|
||||
#ifdef USART_CR1_OVER8
|
||||
LL_USART_SetOverSampling(UartInstance,
|
||||
LL_USART_OVERSAMPLING_16);
|
||||
#endif
|
||||
LL_USART_SetBaudRate(UartInstance,
|
||||
clock_rate,
|
||||
#ifdef USART_PRESC_PRESCALER
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue