Mistake in stm32f0xx_hal_uart_ex.h, missing STM32F030xC check
CubeMX Firmware Package: STM32Cube FW_F0 V1.10.1
CPU: STM32F030RC.
If use it ASIS, compiler will report UART_TXDATA_FLUSH_REQUEST is undefined.
Problem is in line 1: It missed STM32F030xC.
#if !defined(STM32F030x6) && !defined(STM32F030x8)
#define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) \
do{ \
SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \
SET_BIT((__HANDLE__)->Instance->RQR, UART_TXDATA_FLUSH_REQUEST); \
} while(0)
#else
#define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) \
do{ \
SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \
} while(0)
#endif /* !defined(STM32F030x6) && !defined(STM32F030x8) */ After I added STM32F030xC in the check list. It compiles OK.
#if !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC)
#define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) \
do{ \
SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \
SET_BIT((__HANDLE__)->Instance->RQR, UART_TXDATA_FLUSH_REQUEST); \
} while(0)
#else
#define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) \
do{ \
SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \
} while(0)
#endif /* !defined(STM32F030x6) && !defined(STM32F030x8) */ The bottom line is:
STM32F030RC only has USART_RQR_RXFRQ, but not USART_RQR_TXFRQ
I hope ST can fix this error in the future.
