STMicroelectronics / STM32CubeG4

STM32Cube MCU Full Package for the STM32G4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
192 stars 103 forks source link

[LL_USART_Init] - bad assert_param for BRR register maximum value #20

Closed scachemaille closed 3 years ago

scachemaille commented 3 years ago

https://github.com/STMicroelectronics/STM32CubeG4/blob/3e5243a22addb3cd323dba491eaf43c85ff448f3/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_ll_usart.c#L303

this check here is too late and useless. Because LL_USART_SetBaudrate called just above will never set BRR above 0xFFFF (as the higher bits are reserved) without any check if the calculation results in a higher result.

ASELSTM commented 3 years ago

Hi @scachemaille,

Thank you for rising the concern. The issue you pointed out has been confirmed. Indeed the check is useless the IS_LL_USART_BRR_MAX macro will be removed, this will be logged into our internal database to be fixed. The fix will be implemented and made available in future release. Thank you once again for your contribution.

With regards,

ASELSTM commented 3 years ago

ST Internal Reference: 100037

ASELSTM commented 3 years ago

Hi @scachemaille,

I hope you are fine. The issue you reported has been fixed in the frame of version v1.4.0 of the STM32CubeG4 published recently on GitHub.

Thank you again for having reported.

With regards,