新闻中心

EEPW首页>嵌入式系统>设计应用> 关于stm32f1ox.h头文件启动代码与编译器里的宏定义

关于stm32f1ox.h头文件启动代码与编译器里的宏定义

作者: 时间:2016-11-27 来源:网络 收藏
今天调试stm32f107vc发现他的外部时钟竟是25M,和之前的stm32f103rbt6的8M晶振有所区别。
在此总结一下自己的发现。
stm32f107vc属于互联性器件,他的启动文件应该是.cl。对于启动文件有ji个,
.ld
.md
.hd
.cl
.xl
rbt6选用的是md 可以在 keilc++ 宏定义那边说明 STM32F10X_CL,
或者在stm32f10x。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)

本文引用地址: //m.amcfsurvey.com/article/201611/322259.htm

#define STM32F10X_MD

#endif

如果用的是rbt6 如上,如果用的是107 将cl打开

同时我们会看到我们启用了外部的25M晶振,

外部时钟频率选择

#if !definedHSE_VALUE

#ifdef STM32F10X_CL

#define HSE_VALUE((uint32_t)25000000)

#else

#define HSE_VALUE((uint32_t)8000000)

#endif

#endif

最后将.cl启动文件添加到工作组中。




评论


技术专区

关闭