这个问题是正点原子开发板的编译问题
问题:在Keil4中提示如下错误:
Rebuild target 'template'
compiling main.c...
stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
main.c: 1 warning, 1 error
compiling stm32f10x_it.c...
stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
stm32f10x_it.c: 1 warning, 1 error
compiling system_stm32f10x.c...
stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
system_stm32f10x.c: 1 warning, 1 error
compiling core_cm3.c...
assembling startup_stm32f10x_md.s...
compiling misc.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\misc.c: 1 warning, 1 error
compiling stm32f10x_adc.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_adc.c: 1 warning, 1 error
compiling stm32f10x_bkp.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_bkp.c: 1 warning, 1 error
compiling stm32f10x_can.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_can.c: 1 warning, 1 error
compiling stm32f10x_cec.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_cec.c: 1 warning, 1 error
compiling stm32f10x_crc.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_crc.c: 1 warning, 1 error
compiling stm32f10x_dac.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_dac.c: 1 warning, 1 error
compiling stm32f10x_dbgmcu.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_dbgmcu.c: 1 warning, 1 error
compiling stm32f10x_dma.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_dma.c: 1 warning, 1 error
compiling stm32f10x_exti.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_exti.c: 1 warning, 1 error
compiling stm32f10x_flash.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_flash.c: 1 warning, 1 error
compiling stm32f10x_fsmc.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_fsmc.c: 1 warning, 1 error
compiling stm32f10x_gpio.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_gpio.c: 1 warning, 1 error
compiling stm32f10x_i2c.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_i2c.c: 1 warning, 1 error
compiling stm32f10x_iwdg.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_iwdg.c: 1 warning, 1 error
compiling stm32f10x_pwr.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_pwr.c: 1 warning, 1 error
compiling stm32f10x_rcc.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_rcc.c: 1 warning, 1 error
compiling stm32f10x_rtc.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_rtc.c: 1 warning, 1 error
compiling stm32f10x_sdio.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_sdio.c: 1 warning, 1 error
compiling stm32f10x_spi.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_spi.c: 1 warning, 1 error
compiling stm32f10x_tim.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_tim.c: 1 warning, 1 error
compiling stm32f10x_usart.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_usart.c: 1 warning, 1 error
compiling stm32f10x_wwdg.c...
..\USER\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\USER\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\STM32F10X_FWLIB\src\stm32f10x_wwdg.c: 1 warning, 1 error
"..\OBJ\template.axf" - 26 Error(s), 26 Warning(s).
Target not created
分析:因为STM32F1xx_DFP安装包版本不兼容导致的,从而导致了库不兼容
解决办法:
方法1:原先的Keil::STM32F1xx_DFP安装包是你直接从uVision4升级到uVision5后保留的,使用PackInstaller将原先的包1.0.2 Remove + Delete Pack,然后重新下载安装Keil::STM32F1xx_DFP,版本应该是1.0.0,问题解决,库不兼容
方法2:打开“魔法棒”,选中C/C++选项,然后把define中的“STM32F10X_HD,USE_STDPERIPH_DRIVER”改为“STM32F10X_ MD,USE_STDPERIPH_DRIVER”,这种方法不知道有没有什么后遗症。我目前还没有发现。
阅读(17221) | 评论(0) | 转发(1) |