cancel
Showing results for 
Search instead for 
Did you mean: 

clk frequency output problem

Mohamed GORRAB_2
Associate
Posted on April 13, 2018 at 11:13

Hi,

I use the STM32CubeMX to send data using UART, but I have a clock frequency problem,

I configured the clk as shown on the picture below

0690X0000060AaOQAU.png

logically, I should obtain 80MHZ as an outpout frequency, but when I use the scope, it is

fixed

all of the time at 16 MHZ if I use MSI or HSE as shown on the picture below

0690X00000604aRQAQ.jpg

and it is fixed at 32 MHZ if I use the HSI,

0690X00000604a2QAA.jpg

I tried to use the different divisions /1, /8.. and the different clk (PPLCK, SYCLK, HSE...) to obtain the correct frequency, but everytime, I have the same frequency output that I showed on the scope,

The same problem, if I use the HAL_RCC_GetSysClockFreq() instruction, It gives 16 MHz and 32MHz values, we can't reach the 80MHz!!

below the code,

We need to understand this contradiction to advance, because we use the baudrate variable in our project, and the baudrate depends on the frequency value!

Thanks in advance,

Mohamed

6 REPLIES 6
Posted on April 19, 2018 at 01:35

Can't this be the result of the CubeMX bug as in

https://community.st.com/0D50X00009XkWRGSA3

?

JW

Imen.D
ST Employee
Posted on April 19, 2018 at 11:39

Hello

mohamed.gorrab

,

Which firmware package and CubeMX version are you using ?

Could you please confirm if you have the same problem mentioned by waclawek.jan.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Max
ST Employee
Posted on April 19, 2018 at 14:05

Hello, you are either:

- facing the problem pointed by Jan,

- or your HSE oscillator is not working as expected and the clock falls back to HSI (because the CSS is enabled as per your screen shot)

There are many reason that could cause the HSE to fail.

If you are in this case, tell us more about your hardware:

-what board are you using? 

-How is the oscillator designed? ...

Szymon PANECKI
Senior III
Posted on April 20, 2018 at 16:18

Hello Mohamed,

Looking at your clock tree I assume that you work with STM32L4 MCUs family.

It could be that you faced CubeMX issue with code generation for clock domain. Could you please take a look on this thread:

https://community.st.com/0D70X000006SldESAS

? The issue described there is wrong PLLM parameter set by CubeMX.

Regards

Szymon

Posted on April 20, 2018 at 15:14

Hi

DAHMEN.IMEN

‌,

It is CubeMX v4.0, I use IAR embedded for that,

Yes, it's the same problem as

waclawek.jan, As I understand, there is no solution !!!??

Best regards,

Mohamed GORRAB

Nawres GHARBI
ST Employee
Posted on April 23, 2018 at 15:26

Hi Mohamed, 

This is due to the lack of the PLLM configuration, it is a known issue and will be fixed next release. 

As workaround you can use the LL driver for RCC code generation.