diff --git a/demos/STM32/RT-STM32F070RB-NUCLEO64/mcuconf.h b/demos/STM32/RT-STM32F070RB-NUCLEO64/mcuconf.h index 134a6c969..cc5cd7efb 100644 --- a/demos/STM32/RT-STM32F070RB-NUCLEO64/mcuconf.h +++ b/demos/STM32/RT-STM32F070RB-NUCLEO64/mcuconf.h @@ -137,8 +137,7 @@ #define STM32_SERIAL_USE_UART4 FALSE #define STM32_SERIAL_USART1_PRIORITY 3 #define STM32_SERIAL_USART2_PRIORITY 3 -#define STM32_SERIAL_USART3_PRIORITY 3 -#define STM32_SERIAL_UART4_PRIORITY 3 +#define STM32_SERIAL_USART3_8_PRIORITY 3 /* * SPI driver system settings. diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c index 8dadd1193..4014ab5bb 100644 --- a/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c +++ b/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c @@ -53,14 +53,18 @@ #define USART_CR1_M_1 (1 << 28) #endif -/* Handling the case where UART4 and UART5 are actually USARTs, this happens - in the STM32F0xx.*/ +/* Workarounds for those devices where UARTs are USARTs.*/ #if defined(USART4) -#define UART4 USART4 +#define UART4 USART4 #endif - #if defined(USART5) -#define UART5 USART5 +#define UART5 USART5 +#endif +#if defined(USART7) +#define UART7 USART7 +#endif +#if defined(USART8) +#define UART8 USART8 #endif /*===========================================================================*/ diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c index 04e25d9c1..5bf3b6089 100644 --- a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c +++ b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c @@ -30,6 +30,20 @@ /* Driver local definitions. */ /*===========================================================================*/ +/* For compatibility for those devices without LIN support in the USARTs.*/ +#if !defined(USART_ISR_LBDF) +#define USART_ISR_LBDF 0 +#endif + +#if !defined(USART_CR2_LBDIE) +#define USART_CR2_LBDIE 0 +#endif + +/* STM32L0xx/STM32F7xx ST headers difference.*/ +#if !defined(USART_ISR_LBDF) +#define USART_ISR_LBDF USART_ISR_LBD +#endif + /* STM32L0xx/STM32F7xx ST headers difference.*/ #if !defined(USART_ISR_LBDF) #define USART_ISR_LBDF USART_ISR_LBD diff --git a/readme.txt b/readme.txt index e8ed89bfa..7d4122ecc 100644 --- a/readme.txt +++ b/readme.txt @@ -165,6 +165,8 @@ (backported to 16.1.9). - HAL: Fixed dependency to kernel in uart lld (v1) (bug #838)(backported to 16.1.9). +- HAL: Fixed issue with not supported LIN on STM32F070xB (bug #837)(backported + to 16.1.9). - HAL: Fixed STM32 OTGv1 number of endpoints (bug #833)(backported to 16.1.8). - HAL: Fixed transaction end problem with STM32 OTGv1 driver (bug #832) (backported to 16.1.8).