cancel
Showing results for 
Search instead for 
Did you mean: 

clock problem

614678489
Associate II
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 ?
4 REPLIES 4
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
Up vote any posts that you find helpful, it shows what's working..
614678489
Associate II
Posted on August 13, 2012 at 02:43

Thanks, my part is STM32F107

jmelchior9
Associate
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.

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
Up vote any posts that you find helpful, it shows what's working..