Skip to main content
614678489
Associate
August 12, 2012
Question

clock problem

  • August 12, 2012
  • 4 replies
  • 1330 views
Posted on August 12, 2012 at 15:25

I want to use the HSI, and the code is like the following:

void RCC_Configuration(void)

{

 RCC_DeInit();

 RCC_HSICmd(ENABLE);

 RCC_AdjustHSICalibrationValue(0);

 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_AFIO|RCC_APB2Periph_USART1,ENABLE);

}

There is no error during the compilation, but the hardware debug is kind of strange, as shown in the attached.

CFGR=0 means that MCO=0, which then indicates that there is no clock at all....

What's wrong ?
    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    August 12, 2012
    Posted on August 12, 2012 at 20:30

    For your unspecified STM32Fxxx part you might need to consider enabling the PWR/BKP clock, and unlocking the BKP domain.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    614678489
    614678489Author
    Associate
    August 13, 2012
    Posted on August 13, 2012 at 02:43

    Thanks, my part is STM32F107

    jmelchior9
    Visitor II
    August 13, 2012
    Posted on August 13, 2012 at 15:23

    check if the RCC_CR register value is : 0x0000 XX83 where X is undefined.

    In default mode, the HSI clock is enabled.

    Tesla DeLorean
    Guru
    August 13, 2012
    Posted on August 13, 2012 at 16:38

    Sorry, had read LSI/LSE there.

    With the HSE/HSI/PLL one has to make sure not to remove the clock from the CPU, and to bring up, and wait for each to be ready before switching over.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..