cancel
Showing results for 
Search instead for 
Did you mean: 

Help with STM32F4 Clock config

Palacios.Bruno
Associate III
Posted on February 25, 2014 at 15:30

Hi guys,

I need help to configure the stm32f4 clock to disable the pll and just work with the 8MHz external crystal of the discovery board. The goal is to reduce as much as possible the consumption of the microcontroller and see which would be the best crystal/consumption relation to use in my project. I generated a system_stm32f4xx with theCopia de STM32F4xx_Clock_Configuration_V1.1.0 but there wasn´t any difference in the consumption. This is the result of the generated file:

* 5. This file configures the system clock as follows:
*=============================================================================
*=============================================================================
* Supported STM32F40xx/41xx/427x/437x devices
*-----------------------------------------------------------------------------
* System Clock source | HSE
*-----------------------------------------------------------------------------
* SYSCLK(Hz) | 8000000
*-----------------------------------------------------------------------------
* HCLK(Hz) | 8000000
*-----------------------------------------------------------------------------
* AHB Prescaler | 1
*-----------------------------------------------------------------------------
* APB1 Prescaler | 1
*-----------------------------------------------------------------------------
* APB2 Prescaler | 1
*-----------------------------------------------------------------------------
* HSE Frequency(Hz) | 8000000
*-----------------------------------------------------------------------------
* PLL_M | 9
*-----------------------------------------------------------------------------
* PLL_N | 192
*-----------------------------------------------------------------------------
* PLL_P | 6
*-----------------------------------------------------------------------------
* PLL_Q | 4
*-----------------------------------------------------------------------------
* PLLI2S_N | NA
*-----------------------------------------------------------------------------
* PLLI2S_R | NA
*-----------------------------------------------------------------------------
* I2S input clock | NA
*-----------------------------------------------------------------------------
* VDD(V) | 3.3
*-----------------------------------------------------------------------------
* Main regulator output voltage | Scale2 mode
*-----------------------------------------------------------------------------
* Flash Latency(WS) | 0
*-----------------------------------------------------------------------------
* Prefetch Buffer | OFF
*-----------------------------------------------------------------------------
* Instruction cache | ON
*-----------------------------------------------------------------------------
* Data cache | ON
*-----------------------------------------------------------------------------
* Require 48MHz for USB OTG FS, | Disabled
* SDIO and RNG clock |
*-----------------------------------------------------------------------------

Any peace of advice will be appreciated. Best regards, Bruno #stm32 #wait-for-you--clive1-!-!-! #discovery #stm32f4
4 REPLIES 4
Posted on February 25, 2014 at 15:36

Are you able to separate the STM32F4 from the surrounding circuitry?

You could modify SystemInit() to turn on the HSE, and switch to it. If SystemInit() did nothing (empty body) then the part would be running from the 16 MHz HSI.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Palacios.Bruno
Associate III
Posted on February 25, 2014 at 15:50

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6e7&d=%2Fa%2F0X0000000bsO%2FykqfiHuG2aNICz5p976ru2ifnMPwK6jfCo9AW68VBoY&asPdf=false
Posted on February 25, 2014 at 16:04

You should be able to measure current at JP1 (Idd). What amount of current are we talking about, and what kind of equipment are you monitoring it with?

Having the Cortex-M4 idle in a WFI loop should get it too a relatively low level, beyond that you'd need to investigate STOP/STANDBY.

Internal clocks can be confirmed using the MCOx output with suitable routing selected.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Palacios.Bruno
Associate III
Posted on February 25, 2014 at 17:24

We measured the input current of the entire system, which was about 120mA with a fluke tester. I am going to measure in jp1 as you said to be more specific.

Thank you very much!

Bruno