2017-10-11 08:26 AM
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 #stm32cubemxSolved! Go to Solution.
2017-10-12 02:31 AM
Nevermind it's already been reported:
2017-10-12 01:50 AM
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.
2017-10-12 02:18 AM
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
2017-10-12 02:31 AM
Nevermind it's already been reported:
2017-10-12 04:45 AM
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.
2017-10-18 03:11 PM
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.
2019-04-25 02:06 AM
cvv