cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get L432KC SYSCLK to run at 80MHz?

Colin Norris
Associate II
Posted on October 11, 2017 at 17:26

Hi,

I have a L432KC Nucleo 32 and it never runs as fast as I expect it to.

I have configured the clocks in STM32CubeMX as shown in my attached screenshot. I've configured MCO to match the SYSCLK so I can measure it with my oscilloscope.

According to STM32CubeMX, the SYSCLK should be 80MHz, but when I measure it with my oscilloscope, it's only 8MHz. If I change some things (e.g. use HSI RC instead of MSI RC) then I can get different speeds, but they never match the value shown in STM32CubeMX.

My only guess is that this being a low power version of STM32, does it work in some kind of low power mode with a lower clockspeed by default? If so, how do I get it out of that?

Thanks for your help,

Colin

#nucleo-l432kc #stm32cubemx
1 ACCEPTED SOLUTION

Accepted Solutions
Colin Norris
Associate II
Posted on October 12, 2017 at 11:31

Nevermind it's already been reported:

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

View solution in original post

6 REPLIES 6
Kraal
Senior III
Posted on October 12, 2017 at 10:50

Hi !

First, is your oscilloscope capable of measuring such high speed signals ? It could be a good thing to divide the MCO output just to take that out of the equation.

Second, you could use a debugger and read back the RCC registers and check with the RM that everything is configured correctly. Also take a look at the system initialization code generated by CubeMX. While CubeMX is getting less buggy, it still has some bugs in it and maybe that is what you see now.

Colin Norris
Associate II
Posted on October 12, 2017 at 11:18

Hi Kraal, thanks for replying.

Yes I'm using a Rigol DS1104 oscilloscope (100MHz).

I've tried running the Template provided with STM32Cube for the L432KC (I added a line to enable MCO). I found that the template project does run at 80MHz (proves I am measuring it correctly); unfortuantely it's not generated using STM32CubeMX though so I can't just look at the clock configuration tab and copy it visually into my project.

I looked at the actual differences in the 'void SystemClock_Config(void)' in the STM32CubeMX code and the template, and found that the line:

  RCC_OscInitStruct.PLL.PLLM = 1;

is included in the template project, but it's missing from the code generated by STM32CubeMX. If I add that line to my code, the MCO doesn't work anymore (it's always high) but I've got the device sending some SPI messages and my Logic Analyser shows the SPI clock as being the right speed now (80 MHz / 8 = 10 MHz).

So this does seem like a bug in STM32CubeMX. Do you know where I can report that?

Thanks,

Colin

Colin Norris
Associate II
Posted on October 12, 2017 at 11:31

Nevermind it's already been reported:

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

Posted on October 12, 2017 at 11:45

I would say that here is the good place to report a bug. Don't forget to specify the version number of CubeMX and CubeL4.

Posted on October 18, 2017 at 22:11

For others who might happen upon the scope comment, beyond Kraal's more immediate point, it is important to switch 1X/10X probes into 10X mode when trying to measure high frequencies.

Odd that the MCO pin isn't working, the HAL code enables the Pin/AF settings. I have some NUCLEO32-L432KC on order, so might look at that when they arrive.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
JA L
Associate

cvv