2014-10-17 12:36 AM
I am using the STM32CubeMx version 4.3.1 and inside the clock configuration page, the PCLK2 is used for USART1CLK. It shows 2.097.
However, in HAL_RCC_GetPCLK2Freq function, the return value was 2.000. This caused problem with the uart transmitting data, please help to check if there is a bug. I am using the STM32L053 discovery board fyi. Currently the workaround is to manually calculate the BRR and set it after I call the HAL_UART_MspInit. #stm32l0532014-11-19 06:30 AM
const uint32_t MSIRangeTable[7] = {64000, 128000, 256000, 512000, 1000000, 2000000, 4000000};
Next firmware release will provide the solution: the MSI range table has been removed and replaced with a calculation algorithm. Best Regards2014-11-25 09:59 AM
When I saw this problem I modified line97 in stm32l0xx_hal_rcc.c to
const uint32_t MSIRangeTable[7] = {65536, 131072, 262144, 524288, 1048000, 2097000, 4194000};
Note that this was with version 1.0.0 in cube.