Page 1 of 1

STM32F4 Clock source select

Posted: Thu Dec 13, 2012 7:29 pm
by asfarley
How can I change the main clock source to the internal oscillator for the STM32F4?

I've tried changing this line in mcuconf.h:
#define STM32_PLLSRC STM32_PLLSRC_HSE
to this:
#define STM32_PLLSRC STM32_PLLSRC_HSI

but this gives compiler errors:
STM32_PLLVCO outside acceptable ranges

I'm working from the F4 Discovery board project. Does the PLLVC0 require the HSE clock?

To add a little more detail: I'm working from a new PCB layout now where the HSE clock is not populated yet. I'd like to first try with only the internal clock.

Re: STM32F4 Clock source select

Posted: Thu Dec 13, 2012 8:32 pm
by Giovanni
Hi,

You can switch the clock source but you have also to adjust the other parameters in order to keep the various clock points within the acceptable range. In you case the values are calculated for an 8MHz HSE source, if you want to switch to the 16MHz internal source you also have to double the PLL input divider value:

#define STM32_PLLM_VALUE 16

Figure 9 on page 85 of the reference manual explains the various clock paths and dividers.

Giovanni

Re: STM32F4 Clock source select

Posted: Fri Dec 14, 2012 10:46 pm
by pito
Here you may find an utility for clock configuration - it may give you the insides:
http://www.st.com/internet/mcu/product/252149.jsp
Design support
CONFIGURATION UTILITIES
Clock configuration tool for STM32F40x/41x microcontrollers v1.0.1