2016-12-13 03:57 PM
I see that SystemClock_Config(void) is generated, and shows the PLL divisions but it doesn't show anything about the actual clock speeds. Ultimately I'm trying to determine the speed of my ADC sampling but I'm having to work backward as I inherited code from somebody else where all the clocks were set already.
Thanks!
#clocks #discovery #cubemx #stm32l476vgSolved! Go to Solution.
2016-12-14 08:59 AM
This is for the STM32L476VG Discovery board. For the clock configuration I did a search for 'Hz' and eventually traced it back to the 'stml4xx_hal_conf.h' file. In that file there is a section called 'Oscillator Values adaptation' that sets the values (in Hz) for the HSE, MSI, etc.. from there you can determine what your clock frequency is by looking at the PLL values set in SystemClock_Config.
2016-12-13 08:19 PM
You don't mention your part number. So you have to know that and look up the default startup clock for that specific part and its default start frequency. Your data sheet will have a clock tree diagram ( or mine does anyway) and it has a system block diagram showing the buses and peripherals. Then which clocks are selected and enabled based on other clock sources *you* may have that are externally supplying the part. For an L476 -
PLLM is a DIVIDER value.
PLLN is typically a MULTIPLIER value.
PLLP,Q and R are typically DIVIDER values.
That should get you started.
2016-12-14 08:59 AM
This is for the STM32L476VG Discovery board. For the clock configuration I did a search for 'Hz' and eventually traced it back to the 'stml4xx_hal_conf.h' file. In that file there is a section called 'Oscillator Values adaptation' that sets the values (in Hz) for the HSE, MSI, etc.. from there you can determine what your clock frequency is by looking at the PLL values set in SystemClock_Config.