2023-10-03 04:06 AM
Hello,
With CubeMX V6.8 (I did not check with latest update), there is a bug in the USART clock source selection, for chip STM32L451VET
When selecting SYSCLK for USART2 or USART3 (did not check with UART4), in the function HAL_UART_MspInit() the clock is init with :
PeriphClkInit.Usart2ClockSelection = RCC_USART1CLKSOURCE_SYSCLK;
instead of
PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_SYSCLK;
That results in an incorrect initialisation !
I don't know if it is related to the fact that in my project USART1 is also clocked by RCC_USART1CLKSOURCE_SYSCLK
Aurelien
Solved! Go to Solution.
2023-10-04 01:18 AM
I have just tried to reproduce your problem - at least the current versions of STM32CubeMX and STM32CubeIDE generate the correct USART ClockSelection.
Hope that helps?
Regards
/Peter
2023-10-04 01:18 AM
I have just tried to reproduce your problem - at least the current versions of STM32CubeMX and STM32CubeIDE generate the correct USART ClockSelection.
Hope that helps?
Regards
/Peter
2023-10-04 01:28 AM
Hello Peter
I'm deeply sorry for my mistake, it's my only fault when I copied the init parameter from a project copy regenerated with cubemx to my previous project, I copied the same line for the three UART without thinking...
Thank you and sorry again
Aurelien