Clock speed settings: Olimex STM32-E407 board

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
User avatar
stinkytiger
Posts: 9
Joined: Thu Jun 27, 2013 12:53 am

Clock speed settings: Olimex STM32-E407 board

Post by stinkytiger »

Hi,

I have a Olimex board with a STM32F4 chip on it. In the documents it says it can run at 168Mhz. But I understand that this is configurable by changing / setting some registers. I have the following newbie questions:

1) The Olimex STM32-E407 board has a "Canned" set up in Chibios 2.6.2. Does this set up by default run the board at 168Mhz, i.e. max speed?

2) I see that the clock settings is done in os/hal/platforms/STM32F4xx and it relies on #define settings in mcuconf.h. There are some #defines like:

#define STM32_PLLM_VALUE 12

Which I assume refers to the 12 MHZ external clock crystal. There are more defines like:

#define STM32_PLLM_VALUE 12
#define STM32_PLLN_VALUE 336
#define STM32_PLLP_VALUE 2
#define STM32_PLLQ_VALUE 7

Which I think refer to the PLL = Phased Lock Loop clock circuit on the chip. I think these control some divider / pre-scalers that control the frequency that the Cortex M4 runs at. Is there some documentation somehere that describes how these #defines work?

I would like to make sure that the chip is going as fast as it can. :D

Many thanks, Mike.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Clock speed settings: Olimex STM32-E407 board

Post by Giovanni »

Hi,

The board is setup for maximum performance already. In board.h there are the frequency of the crystals, in mcuconf.h there are the PLL settings (the values you mentioned).

The documentation of the settings is in the STM32F4xx reference manual, see the clock sections. Those macros are named like the values in the STM32 RCC registers and act exactly as documented.

Giovanni
User avatar
stinkytiger
Posts: 9
Joined: Thu Jun 27, 2013 12:53 am

Re: Clock speed settings: Olimex STM32-E407 board

Post by stinkytiger »

Thank you Giovanni. That is very helpful and I managed to dig up the pages in the STM32F4 reference manual. That manual sure is a long one!!!!

Best, Mike.
pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: Clock speed settings: Olimex STM32-E407 board

Post by pito »

You may download an excel sheet from STM with all clock coef calculations. Works nice. :)
AN3988 - stm32f4 clock configuration tool, it generates c-code for you with all settings..
http://www.youtube.com/watch?v=L7i3QTYTezE
Post Reply