Skip to main content
anbeyon
Associate II
Sep 15, 2009 7:39 AM UTC
Question

STM32F103RCT - USB CLock configuration

Posted on September 15, 2009 at 09:39

STM32F103RCT - USB CLock configuration

    This topic has been closed for replies.

    2 replies

    anbeyon
    anbeyonAuthor
    Associate II
    May 17, 2011 11:23 AM UTC
    Posted on May 17, 2011 at 13:23

    Hi All

    Please forgive me if the answer to this is really obvious I'm a bit of a newbie and confused.

    I have a board with a STM32F103RCT designed in. It's crystal is 12MHz.

    I am trying to take the DfuSe (Device firmware upgrade) project from 'STM32_USB-FS-Device_Lib' USB projects and make it work on my hardware.

    I'm using the Keil RealView tools and have noticed that the USB Clock is not configured for 48MHz.

    I'm hoping someone can help or at least point me in the right directions.

    So far I've failed miserably to work out what I nned to look at/change.

    Thanks in advance

    Anbeyon

    anbeyon
    anbeyonAuthor
    Associate II
    May 17, 2011 11:23 AM UTC
    Posted on May 17, 2011 at 13:23

    fixed it

    1. in hw_config.c -> set_system()

    change

    /* PLLCLK = 8MHz * 9 = 72 MHz */

    RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);

    to

    /* PLLCLK = 12MHz * 6 = 72 MHz */

    RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_6);

    2. For a correct USART Baudrate in stm32f10x_conf.h

    change

    #define HSE_Value ((u32)8000000) /* Value of the External oscillator in Hz*/

    to

    #define HSE_Value ((u32)12000000) /* Value of the External oscillator in Hz*/