cancel
Showing results for 
Search instead for 
Did you mean: 

USART Clock selection bug / cubemx

Aurelien Robert
Associate III

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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