Keil开发STM32更换MCU造成的编译不通过解决办法
2016-10-02 12:33
459 查看
1.更换MCU型号(我从STM32F103ZET6换成C8T6)
改选STM32F103C8
出现的编译错误:
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'USART1(interrupt)'
compiling stm32f10x_it.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\stm32f10x_it.c: 1 warning, 1 error
compiling main.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\main.c: 1 warning, 1 error
compiling init.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\init.c: 1 warning, 1 error
compiling kalman.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\kalman\kalman.c: 1 warning, 1 error
compiling scheduler.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\scheduler.c: 1 warning, 1 error
compiling mpu6050_measure.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\mpu6050_measure.c: 1 warning, 1 error
compiling bsp_usart1.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\usart\bsp_usart1.c: 1 warning, 1 error
compiling bsp_SysTick.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\SysTick\bsp_SysTick.c: 1 warning, 1 error
compiling attitude computation.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\attitude computation.c: 1 warning, 1 error
compiling bsp_i2c.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\i2c\bsp_i2c.c: 1 warning, 1 error
compiling bsp_mpu6050.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\mpu6050\bsp_mpu6050.c: 1 warning, 1 error
compiling bsp_encoder.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\encoder\bsp_encoder.c: 1 warning, 1 error
assembling startup_stm32f10x_hd.s...
compiling core_cm3.c...
compiling system_stm32f10x.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\CMSIS\system_stm32f10x.c: 1 warning, 1 error
compiling misc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\misc.c: 1 warning, 1 error
compiling stm32f10x_adc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_adc.c: 1 warning, 1 error
compiling stm32f10x_bkp.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_bkp.c: 1 warning, 1 error
compiling stm32f10x_can.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!&l
4000
t; ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_can.c: 1 warning, 1 error
compiling stm32f10x_cec.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_cec.c: 1 warning, 1 error
compiling stm32f10x_crc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_crc.c: 1 warning, 1 error
compiling stm32f10x_dac.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_dac.c: 1 warning, 1 error
compiling stm32f10x_dbgmcu.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_dbgmcu.c: 1 warning, 1 error
compiling stm32f10x_dma.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_dma.c: 1 warning, 1 error
compiling stm32f10x_exti.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_exti.c: 1 warning, 1 error
compiling stm32f10x_flash.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_flash.c: 1 warning, 1 error
compiling stm32f10x_fsmc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_fsmc.c: 1 warning, 1 error
compiling stm32f10x_gpio.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_gpio.c: 1 warning, 1 error
compiling stm32f10x_i2c.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_i2c.c: 1 warning, 1 error
compiling stm32f10x_iwdg.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_iwdg.c: 1 warning, 1 error
compiling stm32f10x_pwr.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_pwr.c: 1 warning, 1 error
compiling stm32f10x_rcc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_rcc.c: 1 warning, 1 error
compiling stm32f10x_rtc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_rtc.c: 1 warning, 1 error
compiling stm32f10x_sdio.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_sdio.c: 1 warning, 1 error
compiling stm32f10x_spi.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_spi.c: 1 warning, 1 error
compiling stm32f10x_tim.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_tim.c: 1 warning, 1 error
compiling stm32f10x_usart.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_usart.c: 1 warning, 1 error
compiling stm32f10x_wwdg.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_wwdg.c: 1 warning, 1 error
"..\..\Output\Template.axf" - 36 Error(s), 36 Warning(s).
Target not created.
Build Time Elapsed: 00:00:11
这个问题是因为对应处理器内部资源少于启动文件中提及的内部资源,启动文件中某一部分寄存器地址在F103C8中没有,才会编译出错。
2.更换启动文件宏定义
由于STM32F103系列的不同型号MCU内部ROM和RAM不同,其地址区间也有些许差异
所以需要选择与型号对应的启动文件,并配置对应的宏定义
startup_stm32f10x_cl.s
互联型的器件,STM32F105xx,STM32F107xx
startup_stm32f10x_hd.s
大容量的STM32F101xx,STM32F102xx,STM32F103xx
startup_stm32f10x_hd_vl.s
大容量的STM32F100xx
startup_stm32f10x_ld.s
小容量的STM32F101xx,STM32F102xx,STM32F103xx
startup_stm32f10x_ld_vl.s
小容量的STM32F100xx
startup_stm32f10x_md.s
中容量的STM32F101xx,STM32F102xx,STM32F103xx
startup_stm32f10x_md_vl.s
中容量的STM32F100xx
startup_stm32f10x_xl.s FLASH在512K到1024K字节的STM32F101xx,STM32F102xx,STM32F103xx
cl:互联型产品,stm32f105/107系列
vl:超值型产品,stm32f100系列
xl:超高密度产品,stm32f101/103系列
ld:低密度产品,FLASH小于64K
md:中等密度产品,FLASH=64 or 128
hd:高密度产品,FLASH大于128
ZET6的启动文件配置:
把STM32F10X_HD换成STM32F10X_MD
编译结果(能够通过):
做到这一步应该就可以用了,但是我还没有检查具体的内存地址空间,可以找个最小系统板下载一下就知道能不能用了。
现在存在的问题是启动文件用的还是HD版本的,能够编译MD通过但是还是想换成MD。
3.更换启动文件
更换前:
更换过程:
添加新的md文件,然后把hd文件删除
编译后能够通过。
4.可能出现的问题
error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.
网上的解决方案:
http://www.cnblogs.com/wellrun/archive/2011/03/21/1990074.html
编译环境:RVMDK
CPU :STM32F103VC
错误:.\obj\movSERVO.sct(7): error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.
原因:项目中同时包含以下启动文件,
startup_stm32f10x_hd.s
startup_stm32f10x_md.s
startup_stm32f10x_ld.s
......
应该针对不同的CPU选择不同的启动文件。
解决办法1:从项目中删除不相关的启动文件
解决办法2:右击不相关的启动文件,点击 options for file 'startup_stm32f10x_md.s'...
在弹出的对话框中的properties页,勾去灰化的'Include in Target Build'和‘Always Build’两项。
这个博客已经说明了问题的原因,但是导致问题的原因在Keil本身。
keil的这个地方有时候会出现一个选项,下方这个截图里没有出现。我在用Keil 5.14时会出现,刚才升级到5.21a后就没有再次出现。
那个选项里面会出现不少启动文件和相关文件,这些文件也自动加入编译,导致了有多个启动文件造成冲突,
解决方案:
右键,点击第一行
把Use for all project targets前面的勾选取消,点击ok
再编译就没有这个冲突了。
改选STM32F103C8
出现的编译错误:
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'USART1(interrupt)'
compiling stm32f10x_it.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\stm32f10x_it.c: 1 warning, 1 error
compiling main.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\main.c: 1 warning, 1 error
compiling init.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\init.c: 1 warning, 1 error
compiling kalman.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\kalman\kalman.c: 1 warning, 1 error
compiling scheduler.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\scheduler.c: 1 warning, 1 error
compiling mpu6050_measure.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\mpu6050_measure.c: 1 warning, 1 error
compiling bsp_usart1.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\usart\bsp_usart1.c: 1 warning, 1 error
compiling bsp_SysTick.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\SysTick\bsp_SysTick.c: 1 warning, 1 error
compiling attitude computation.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\attitude computation.c: 1 warning, 1 error
compiling bsp_i2c.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\i2c\bsp_i2c.c: 1 warning, 1 error
compiling bsp_mpu6050.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\mpu6050\bsp_mpu6050.c: 1 warning, 1 error
compiling bsp_encoder.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\User\encoder\bsp_encoder.c: 1 warning, 1 error
assembling startup_stm32f10x_hd.s...
compiling core_cm3.c...
compiling system_stm32f10x.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\CMSIS\system_stm32f10x.c: 1 warning, 1 error
compiling misc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\misc.c: 1 warning, 1 error
compiling stm32f10x_adc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_adc.c: 1 warning, 1 error
compiling stm32f10x_bkp.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_bkp.c: 1 warning, 1 error
compiling stm32f10x_can.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!&l
4000
t; ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_can.c: 1 warning, 1 error
compiling stm32f10x_cec.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_cec.c: 1 warning, 1 error
compiling stm32f10x_crc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_crc.c: 1 warning, 1 error
compiling stm32f10x_dac.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_dac.c: 1 warning, 1 error
compiling stm32f10x_dbgmcu.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_dbgmcu.c: 1 warning, 1 error
compiling stm32f10x_dma.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_dma.c: 1 warning, 1 error
compiling stm32f10x_exti.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_exti.c: 1 warning, 1 error
compiling stm32f10x_flash.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_flash.c: 1 warning, 1 error
compiling stm32f10x_fsmc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_fsmc.c: 1 warning, 1 error
compiling stm32f10x_gpio.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_gpio.c: 1 warning, 1 error
compiling stm32f10x_i2c.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_i2c.c: 1 warning, 1 error
compiling stm32f10x_iwdg.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_iwdg.c: 1 warning, 1 error
compiling stm32f10x_pwr.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_pwr.c: 1 warning, 1 error
compiling stm32f10x_rcc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_rcc.c: 1 warning, 1 error
compiling stm32f10x_rtc.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_rtc.c: 1 warning, 1 error
compiling stm32f10x_sdio.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_sdio.c: 1 warning, 1 error
compiling stm32f10x_spi.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_spi.c: 1 warning, 1 error
compiling stm32f10x_tim.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_tim.c: 1 warning, 1 error
compiling stm32f10x_usart.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_usart.c: 1 warning, 1 error
compiling stm32f10x_wwdg.c...
..\..\Libraries\CMSIS\stm32f10x.h(298): error: #67: expected a "}"
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
..\..\Libraries\CMSIS\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error
} IRQn_Type;
..\..\Libraries\FWlib\src\stm32f10x_wwdg.c: 1 warning, 1 error
"..\..\Output\Template.axf" - 36 Error(s), 36 Warning(s).
Target not created.
Build Time Elapsed: 00:00:11
这个问题是因为对应处理器内部资源少于启动文件中提及的内部资源,启动文件中某一部分寄存器地址在F103C8中没有,才会编译出错。
2.更换启动文件宏定义
由于STM32F103系列的不同型号MCU内部ROM和RAM不同,其地址区间也有些许差异
所以需要选择与型号对应的启动文件,并配置对应的宏定义
startup_stm32f10x_cl.s
互联型的器件,STM32F105xx,STM32F107xx
startup_stm32f10x_hd.s
大容量的STM32F101xx,STM32F102xx,STM32F103xx
startup_stm32f10x_hd_vl.s
大容量的STM32F100xx
startup_stm32f10x_ld.s
小容量的STM32F101xx,STM32F102xx,STM32F103xx
startup_stm32f10x_ld_vl.s
小容量的STM32F100xx
startup_stm32f10x_md.s
中容量的STM32F101xx,STM32F102xx,STM32F103xx
startup_stm32f10x_md_vl.s
中容量的STM32F100xx
startup_stm32f10x_xl.s FLASH在512K到1024K字节的STM32F101xx,STM32F102xx,STM32F103xx
cl:互联型产品,stm32f105/107系列
vl:超值型产品,stm32f100系列
xl:超高密度产品,stm32f101/103系列
ld:低密度产品,FLASH小于64K
md:中等密度产品,FLASH=64 or 128
hd:高密度产品,FLASH大于128
ZET6的启动文件配置:
把STM32F10X_HD换成STM32F10X_MD
编译结果(能够通过):
做到这一步应该就可以用了,但是我还没有检查具体的内存地址空间,可以找个最小系统板下载一下就知道能不能用了。
现在存在的问题是启动文件用的还是HD版本的,能够编译MD通过但是还是想换成MD。
3.更换启动文件
更换前:
更换过程:
添加新的md文件,然后把hd文件删除
编译后能够通过。
4.可能出现的问题
error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.
网上的解决方案:
http://www.cnblogs.com/wellrun/archive/2011/03/21/1990074.html
编译环境:RVMDK
CPU :STM32F103VC
错误:.\obj\movSERVO.sct(7): error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.
原因:项目中同时包含以下启动文件,
startup_stm32f10x_hd.s
startup_stm32f10x_md.s
startup_stm32f10x_ld.s
......
应该针对不同的CPU选择不同的启动文件。
解决办法1:从项目中删除不相关的启动文件
解决办法2:右击不相关的启动文件,点击 options for file 'startup_stm32f10x_md.s'...
在弹出的对话框中的properties页,勾去灰化的'Include in Target Build'和‘Always Build’两项。
这个博客已经说明了问题的原因,但是导致问题的原因在Keil本身。
keil的这个地方有时候会出现一个选项,下方这个截图里没有出现。我在用Keil 5.14时会出现,刚才升级到5.21a后就没有再次出现。
那个选项里面会出现不少启动文件和相关文件,这些文件也自动加入编译,导致了有多个启动文件造成冲突,
解决方案:
右键,点击第一行
把Use for all project targets前面的勾选取消,点击ok
再编译就没有这个冲突了。
相关文章推荐
- Keil开发STM32更换MCU造成的编译不通过的解决办法
- STM32关于uversion版本更换和MCU型号更换编译出错的解决办法、记录。
- Keil V5版本开发STM32缺少PACKDFP解决办法
- android 开发 @override 编译错误 解决办法
- android 开发中通过JNI无法向SD卡写入文件的解决办法
- 【游戏开发备注之一】关于Cocos2dx_v1.x版本iphone与Android运行出现图片白块、添加GameCenter报错问题及编译Android闪退的解决办法&&CCLOG与CClog的区别
- 【COCOS2DX-LUA 脚本开发之十四】解决自定义CPP类通过TOLUA++ BINDING LUACOCOS2D后编译到ANDROID运行黑屏(没有调用自定义CPP类)的问题!
- Android项目更换开发环境时出现的 java.lang.VerifyError 异常解决办法
- 通过mk文件编译android4.0.3系统app源码后覆盖安装失败解决办法(android odex文件)
- 动态库的gcc版本不一致造成的编译问题的解决办法
- Linux下时间戳不同步造成编译警告的解决办法
- VS2008下最新X264(svn 2009.0216)编译不过的解决办法(附编译通过+修改内存泄露版本)
- Web开发中常见的安全缺陷及解决办法(作者:Amit Klein ;仙人掌工作室 编译 发文时间:2003.10.23)(赛迪转载)
- android 开发 @override 编译错误 解决办法(转载)
- android 开发 @override 编译错误 解决办法
- (iPhone/iPad开发)解决CAStreamBasicDescription在项目中无法编译通过问题
- ON_WM_NCHITTEST和其他MFC宏在vs2005下不能编译通过的解决办法
- VS2008下最新X264(svn 2009.0216)编译不过的解决办法(附编译通过+修改内存泄露版本)
- 嵌入式开发六:busybox编译根文件系统的一些错误解决办法
- Cocos2d-x for win8 编译通过,无法运行的解决办法