STM32F4 Clock source select

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
asfarley
Posts: 8
Joined: Thu Dec 13, 2012 7:19 pm

STM32F4 Clock source select

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32F4 Clock source select

Post 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
pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: STM32F4 Clock source select

Post 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
Post Reply