2008-10-21 05:21 AM
HSEStartUpStatus behaves differently (fails) with identical code
2011-05-17 03:48 AM
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, Owen2011-05-17 03:48 AM
The timeout is set to
#define HSEStartUp_TimeOut ((u16)0x01FF) in both cases.2011-05-17 03:48 AM
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