AnsweredAssumed Answered

Setting up HSE on STM32F4 Discovery

Question asked by jdcowpland on Dec 12, 2013
Latest reply on Dec 12, 2013 by jdcowpland
I'm sure there's probably already a post on how to do this, but I can't find it so here goes:

I'm trying to set up the external 8 MHz oscillator on the F4 Discovery. I'm using Keil IDE and have set my xtal osc to 8.0 MHz in the target options. I've then added this code to my setup:
void RCC_Configuration(void){
  RCC_DeInit();
    // Enable HSE
    RCC_HSEConfig(RCC_HSE_ON);
    while(RCC_WaitForHSEStartUp() == SUCCESS);
    RCC_PLLConfig(RCC_PLLSource_HSE,8,336,2,7);// Source = HSE, M = 8, N = 336, P = 2, Q = 7
    RCC_PLLCmd(ENABLE);
    RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
    RCC_HCLKConfig(RCC_SYSCLK_Div1);
    RCC_PCLK1Config(RCC_HCLK_Div4);
    RCC_PCLK2Config(RCC_HCLK_Div4);
}
Unsurprisingly, it doesn't seem to work. Can anyone help out?

Outcomes