keil编译出错

版权声明:吴亚彪 https://blog.csdn.net/weixin_44288260/article/details/85716255

keil出错

按照工程文件建立工程后,编译keil出现很多错误。在这里插入图片描述
在.c文件中没有stm32f10x_conf.h文件,原因是缺少预处理指令.
在这里插入图片描述此时加入USE_STDPERIPH_DRIVER, STM32F10X_MD即可解决错误。注意:此时要按照自己的芯片选择(LD,MD,HD,)
在这里插入图片描述这是在stm32f10x.h中定义了


95 #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)
96 #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
97 #endif

8296 #ifdef USE_STDPERIPH_DRIVER
8297  #include "stm32f10x_conf.h"
8298 #endif

keil 快捷键

F7 建立工程
ctrl+F2 设置标记 F2 ,shift+F2 标记变化
ctrl+F5 debug F5运行 F9插入中断

猜你喜欢

转载自blog.csdn.net/weixin_44288260/article/details/85716255