2010-04-27 06:22 AM
SystemFrequency takes the right core clock frequency?
2011-05-17 04:48 AM
Hi,
You have just to update HSE_Value in your Toolchain preprocessor, by default it is defined in File \Libraries\CMSIS\Core\CM3\stm32f10x.h : /** * @brief In the following line adjust the value of External High Speed oscillator (HSE) used in your application Tip: To avoid modifying this file each time you need to use different HSE, you can define the HSE value in your toolchain compiler preprocessor. */ #if !defined HSE_Value #ifdef STM32F10X_CL #define HSE_Value ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ #else #define HSE_Value ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* STM32F10X_CL */ #endif /* HSE_Value */ SystemFrequency is computing the Frequency based on this ''Value''. Hope it helps you. Cheers, STOne-32.2011-05-17 04:48 AM
I'm using IAR, as far as I know I can add global defines as I would write
#define MYDEFINE but not #define MYDEFINE 0 Anyway, HSE_Value is se to the correct value (8M) but I get 72M as SystemFrequency. Am I running at that core frequency?2011-05-17 04:48 AM
probably I am missing something, but that HSE_Value is correctly set. If I printout its value it shows 8000000; that's the correct value for my HSE clock, yet the SystemFrequency shows 72000000 whether I am running at 36 or 8 MHz