AnsweredAssumed Answered

Clock setting for stm32f105rc

Question asked by sangdo.lee on Feb 6, 2016
Latest reply on Feb 8, 2016 by sangdo.lee
I made a custom board using stm32f105rc with external 8MHz x-tal.
I think I would set the system clock with HSE,PLL,72MHz.
But each stm32f105 board's SysTick_Handler timing are not same. 10,000 tick is 1 sec. 
In some board, 9645 tick is 1 sec, for other board, 9834 tick is 1 sec.... 
I think the system is not set to HSE/PLL, but HSI. But I'm not sure. Just guessing from different SysTick for all the board.

My program regarding clock setting are bellow.

----------
stmf1xx.h
#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL) 
  /* #define STM32F10X_LD */     /*!< STM32F10X_LD: STM32 Low density devices */
  /* #define STM32F10X_LD_VL */  /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */  
     //#define STM32F10X_MD    /*!< STM32F10X_MD: STM32 Medium density devices */
  /* #define STM32F10X_MD_VL */  /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */  
     #define STM32F10X_HD     /*!< STM32F10X_HD: STM32 High density devices */
     //#define STM32F10X_HD_VL  /*!< STM32F10X_HD_VL: STM32 High density value line devices */  
  /* #define STM32F10X_XL */     /*!< STM32F10X_XL: STM32 XL-density devices */
//#define STM32F10X_CL     /*!< STM32F10X_CL: STM32 Connectivity line devices */
#endif

system_stm32f1xx.c

#if defined (STM32F10X_LD_VL) || (defined STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
// #define SYSCLK_FREQ_HSE    HSE_VALUE
//     #define SYSCLK_FREQ_24MHz  24000000
#else
// #define SYSCLK_FREQ_HSE    HSE_VALUE
/* #define SYSCLK_FREQ_24MHz  24000000 */ 
//#define SYSCLK_FREQ_36MHz  36000000
/* #define SYSCLK_FREQ_48MHz  48000000 */
/* #define SYSCLK_FREQ_56MHz  56000000 */
#define SYSCLK_FREQ_72MHz  72000000
#endif



Outcomes