cancel
Showing results for 
Search instead for 
Did you mean: 

Bugreport in stm32f3 USART HAL - wrong USART_IT_CM value defined in library

ssubrt9
Associate
Posted on October 01, 2014 at 14:01

Hello,

I would like to report a bug in this USART HAL file:

/**

  ******************************************************************************

  * @file    stm32f3xx_hal_uart.h

  * @author  MCD Application Team

  * @version V1.0.1

  * @date    18-June-2014

  * @brief   Header file of UART HAL module.

  ******************************************************************************

In that file you can find

#define UART_IT_CM                          ((uint16_t)0x142E)

#define UART_IT_WUF                         ((uint16_t)0x1476)

UART_IT_CM value is wrong (should indicate bit position in ISR register therefore there shouldnt be two definitions starting 0x14...) With current value it is possible to enable interrupt but not possible to check if that interrupt is pending.

Correct value is:

#define UART_IT_CM                          ((uint16_t)0x112E)

Also the documentation is wrong about ZZZZ part

/** @defgroup UART_Interrupt_definition   UART Interrupts Definition

  *        Elements values convention: 0000ZZZZ0XXYYYYYb

  *           - YYYYY  : Interrupt source position in the XX register (5bits)

  *           - XX  : Interrupt source register (2bits)

  *                 - 01: CR1 register

  *                 - 10: CR2 register

  *                 - 11: CR3 register

  *           - ZZZZ  : Flag position in the ISR register(4bits)

  * @{

  */

4 bits for ISR flag definition is not enough and you need at least 5 (for instance for Character match interrupt at bit 17)

Hope it helps somebody

With best regards

Stanislav Subrt
1 REPLY 1
Posted on October 01, 2014 at 19:45

Hi Stanislav Subrt,

Thanks for the feedback. We’ve noted this as a problem and we’ll pass it along to our development team.

Best regards,

Heisenberg.