cancel
Showing results for 
Search instead for 
Did you mean: 

HSEStartUpStatus behaves differently (fails) with identical code

okelly2
Associate II
Posted on October 21, 2008 at 14:21

HSEStartUpStatus behaves differently (fails) with identical code

3 REPLIES 3
okelly2
Associate II
Posted on May 17, 2011 at 12:48

Hi there,

I am confused by the fact that I can't start the HSE. I have two projects that have identical initial code:

Code:

/* RCC system reset(for debug purpose) */

RCC_DeInit();

/* Enable HSE */

RCC_HSEConfig(RCC_HSE_ON);

/* Wait till HSE is ready */

HSEStartUpStatus = RCC_WaitForHSEStartUp();

if(HSEStartUpStatus == SUCCESS) {

// project 1 reaches here. Uses FW2.0.1.

}else{

// project 2 reaches here. Uses FW2.0.2.

}

One project has HSEStartUpStatus == SUCCESS and the other one does not.

These are running on the same STM3210-E Eval board. These are the very first executed lines in both programs. Since the code is identical, I suppose I should look for differences in the include files and in the IAR EWARM 5.20 project configurations. Any other ideas?

A clue may be that project 2 is being migrated from a medium density device project.

Both projects have

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

in stm32f10x_conf.h.

Regarding RCC_HSEConfig, the Firmware manual states

''HSE can not be stopped if it is used directly or through the PLL as

system clock.''

but I don't see how I could be violating this if these are the first lines of code. I don't think the system clock is configured yet. But I am no expert on the clock tree.

Any ideas?

Thanks and regards,

Owen

okelly2
Associate II
Posted on May 17, 2011 at 12:48

The timeout is set to

#define HSEStartUp_TimeOut ((u16)0x01FF)

in both cases.

okelly2
Associate II
Posted on May 17, 2011 at 12:48

Problem solved. In fact, the code was *not* identical.

The hw_config.c file that I was ''working on'' was not in fact the one that was compiled into the project.

-Owen