cancel
Showing results for 
Search instead for 
Did you mean: 

Mistake in stm32f0xx_hal_uart_ex.h, missing STM32F030xC check

bonmotwang
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

2 REPLIES 2
Imen.D
ST Employee

Hello @bonmotwang​ ,

Welcome to the STM32 Community 😊 and thanks for your post.

I will check that out and get back to you on the corrective actions we will take.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen