drivers: serial: stm32: Add Line Break Detection
The current driver doesn't handle the LBD flag, this leads uart_stm32_err_check to return always true if a Line Break is detected. This PR adds Line Break Detection and the related flag clearing, F0 series it's excluded from the changes. Fixes zephyrproject-rtos#41339 Signed-off-by: Andrea Campanella <andrea.campanella@helvar.com>
This commit is contained in:
parent
0c30db1ec5
commit
b2190fd703
1 changed files with 10 additions and 1 deletions
|
@ -586,6 +586,16 @@ static int uart_stm32_err_check(const struct device *dev)
|
|||
err |= UART_ERROR_FRAMING;
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_SOC_SERIES_STM32F0X) || defined(USART_LIN_SUPPORT)
|
||||
if (LL_USART_IsActiveFlag_LBD(UartInstance)) {
|
||||
err |= UART_BREAK;
|
||||
}
|
||||
|
||||
if (err & UART_BREAK) {
|
||||
LL_USART_ClearFlag_LBD(UartInstance);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (err & UART_ERROR_OVERRUN) {
|
||||
LL_USART_ClearFlag_ORE(UartInstance);
|
||||
}
|
||||
|
@ -597,7 +607,6 @@ static int uart_stm32_err_check(const struct device *dev)
|
|||
if (err & UART_ERROR_FRAMING) {
|
||||
LL_USART_ClearFlag_FE(UartInstance);
|
||||
}
|
||||
|
||||
/* Clear noise error as well,
|
||||
* it is not represented by the errors enum
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue