2020-12-08 12:44 PM
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.
Solved! Go to Solution.
2020-12-09 11:07 AM
Hi @bonmotwang ,
Please download and use latest STM32CubeF0 V1.11.2 which contains enhancement and fix your issue.
Please mark my answer as best by clicking on the "Select as Best" button if it fully solved your issue. This will help other users find this solution more quickly.
Imen
2020-12-08 10:15 PM
Hello @bonmotwang ,
Welcome to the STM32 Community :smiling_face_with_smiling_eyes: and thanks for your post.
I will check that out and get back to you on the corrective actions we will take.
Imen
2020-12-09 11:07 AM
Hi @bonmotwang ,
Please download and use latest STM32CubeF0 V1.11.2 which contains enhancement and fix your issue.
Please mark my answer as best by clicking on the "Select as Best" button if it fully solved your issue. This will help other users find this solution more quickly.
Imen