菜鸟求助!
时间:10-02
整理:3721RD
点击:
编译出错,为什么啊?请求高手指点
Build target 'Target 1'
compiling stm32f10x_gpio.c...
..\libraries\src\stm32f10x_gpio.c(111): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(178): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(183): error: #20: identifier "currentmode" is undefined
..\libraries\src\stm32f10x_gpio.c: currentmode = ((uint32_t)GPIO_InitStruct->GPIO_Mode) & ((uint32_t)0x0F);
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(195): error: #20: identifier "tmpreg" is undefined
..\libraries\src\stm32f10x_gpio.c: tmpreg = GPIOx->CRL;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(196): error: #20: identifier "pinpos" is undefined
..\libraries\src\stm32f10x_gpio.c: for (pinpos = 0x00; pinpos < 0x08; pinpos++)
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(198): error: #20: identifier "pos" is undefined
..\libraries\src\stm32f10x_gpio.c: pos = ((uint32_t)0x01) << pinpos;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(200): error: #20: identifier "currentpin" is undefined
..\libraries\src\stm32f10x_gpio.c: currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(205): error: #20: identifier "pinmask" is undefined
..\libraries\src\stm32f10x_gpio.c: pinmask = ((uint32_t)0x0F) << pos;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(230): error: #20: identifier "tmpreg" is undefined
..\libraries\src\stm32f10x_gpio.c: tmpreg = GPIOx->CRH;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(231): error: #20: identifier "pinpos" is undefined
..\libraries\src\stm32f10x_gpio.c: for (pinpos = 0x00; pinpos < 0x08; pinpos++)
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(233): error: #20: identifier "pos" is undefined
..\libraries\src\stm32f10x_gpio.c: pos = (((uint32_t)0x01) << (pinpos + 0x08));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(235): error: #20: identifier "currentpin" is undefined
..\libraries\src\stm32f10x_gpio.c: currentpin = ((GPIO_InitStruct->GPIO_Pin) & pos);
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(240): error: #20: identifier "pinmask" is undefined
..\libraries\src\stm32f10x_gpio.c: pinmask = ((uint32_t)0x0F) << pos;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(286): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(308): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(324): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(346): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(361): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(377): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(397): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(420): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(437): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(466): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_PortSource));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(486): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_FUNCTIONAL_STATE(NewState));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(554): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_REMAP(GPIO_Remap));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(559): error: #136: struct "<unnamed>" has no field "MAPR2"
..\libraries\src\stm32f10x_gpio.c: tmpreg = AFIO->MAPR2;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(593): error: #136: struct "<unnamed>" has no field "MAPR2"
..\libraries\src\stm32f10x_gpio.c: AFIO->MAPR2 = tmpreg;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(613): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_EXTI_PORT_SOURCE(GPIO_PortSource));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(632): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ETH_MEDIA_INTERFACE(GPIO_ETH_MediaInterface));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c: ..\libraries\src\stm32f10x_gpio.c: 16 warnings, 13 errors
compiling system_stm32f10x.c...
..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error: #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ^
..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c: 0 warnings, 1 error
Target not created
Build target 'Target 1'
compiling stm32f10x_gpio.c...
..\libraries\src\stm32f10x_gpio.c(111): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(178): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(183): error: #20: identifier "currentmode" is undefined
..\libraries\src\stm32f10x_gpio.c: currentmode = ((uint32_t)GPIO_InitStruct->GPIO_Mode) & ((uint32_t)0x0F);
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(195): error: #20: identifier "tmpreg" is undefined
..\libraries\src\stm32f10x_gpio.c: tmpreg = GPIOx->CRL;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(196): error: #20: identifier "pinpos" is undefined
..\libraries\src\stm32f10x_gpio.c: for (pinpos = 0x00; pinpos < 0x08; pinpos++)
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(198): error: #20: identifier "pos" is undefined
..\libraries\src\stm32f10x_gpio.c: pos = ((uint32_t)0x01) << pinpos;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(200): error: #20: identifier "currentpin" is undefined
..\libraries\src\stm32f10x_gpio.c: currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(205): error: #20: identifier "pinmask" is undefined
..\libraries\src\stm32f10x_gpio.c: pinmask = ((uint32_t)0x0F) << pos;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(230): error: #20: identifier "tmpreg" is undefined
..\libraries\src\stm32f10x_gpio.c: tmpreg = GPIOx->CRH;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(231): error: #20: identifier "pinpos" is undefined
..\libraries\src\stm32f10x_gpio.c: for (pinpos = 0x00; pinpos < 0x08; pinpos++)
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(233): error: #20: identifier "pos" is undefined
..\libraries\src\stm32f10x_gpio.c: pos = (((uint32_t)0x01) << (pinpos + 0x08));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(235): error: #20: identifier "currentpin" is undefined
..\libraries\src\stm32f10x_gpio.c: currentpin = ((GPIO_InitStruct->GPIO_Pin) & pos);
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(240): error: #20: identifier "pinmask" is undefined
..\libraries\src\stm32f10x_gpio.c: pinmask = ((uint32_t)0x0F) << pos;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(286): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(308): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(324): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(346): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(361): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(377): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(397): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(420): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(437): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(466): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_PortSource));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(486): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_FUNCTIONAL_STATE(NewState));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(554): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_REMAP(GPIO_Remap));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(559): error: #136: struct "<unnamed>" has no field "MAPR2"
..\libraries\src\stm32f10x_gpio.c: tmpreg = AFIO->MAPR2;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(593): error: #136: struct "<unnamed>" has no field "MAPR2"
..\libraries\src\stm32f10x_gpio.c: AFIO->MAPR2 = tmpreg;
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(613): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_EXTI_PORT_SOURCE(GPIO_PortSource));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c(632): warning: #223-D: function "assert_param" declared implicitly
..\libraries\src\stm32f10x_gpio.c: assert_param(IS_GPIO_ETH_MEDIA_INTERFACE(GPIO_ETH_MediaInterface));
..\libraries\src\stm32f10x_gpio.c: ^
..\libraries\src\stm32f10x_gpio.c: ..\libraries\src\stm32f10x_gpio.c: 16 warnings, 13 errors
compiling system_stm32f10x.c...
..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error: #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ^
..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h: ..\libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c: 0 warnings, 1 error
Target not created
应该是没有链接到库函数,所以编译时出错
assert_param应该是在stm32f10x_conf.h
看一下你有没有include,还有这个库有没有在目录里