1.新建工程的时候编译出现如下错误(MDK4.12 使用v3.4的库) ..CMSISstm32f10x.h(80): error: #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" 解决方法:双击错误进入出错的地方,在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)
- #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
- #endif
这时需要设置预处理编译符号:由于自己使用的是红牛开发板,所用芯片为STM32F103ZET6,故添加STM32F10X_HD符号,如下图:
设置完成之后重新编译出现新的问题: ..StdPeriph_Libsrcmisc.c(98): warning: #223-D: function "assert_param" declared implicitly ...... ...... .ObjProLed.axf: Error: L6218E: Undefined symbol assert_param (referred from misc.o). 需要添加一个新的预处理符号:USE_STDPERIPH_DRIVER,与之前的STM32F10X_HD符号用一个空格隔开。
附上一个自己新作的模板: 固件库:v3.4 软件版本:RealView MDK 4.12 01_ProLed.rar
|