kiel5编译报错error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.

原因是startup_xxx.s文件只能保留其中一种**

启动文件分别带有hdmdld三种字样。需要查看mcu的flash内存大小来选择。
256 ~512 Kbytes:使用该文件 startup_xxx_hd.s 和 startup_xxx_hd_vl.s
64 ~128 Kbytes :使用该文件 startup_xxx_md.s和 startup_xxx_md_vl.s
16 ~32 Kbytes :使用文件 startup_xxx_ld.s 和 startup_xxx_ld_vl.s

PS:h代表high,高容量的意思; m代表middle,中等容量; l代表low,低容量

我使用的是STM32F1C8T6,64kb的flash,所有选择startup_xxx_md.s和 startup_xxx_md_vl.s两个文件。如果之选其中一个文件会有报错。


重新编译又报错 Undefined symbol SystemInit (referred from startup_stm32f10x_md.o).

这个是指startup_stm32f10x_md.o文件中的SystemInit符号没有定义。这个.o文件是由startup_stm32f10x_md.s文件生成的。
按照网上找的方法,把startup_stm32f10x_md.s文件中的这段注释掉。
kiel5编译报错error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.
然后再次编译,终于正常了。撒花~!!

参考博文:https://www.cnblogs.com/wellrun/archive/2011/03/21/1990074.html
https://www.cnblogs.com/lovexz/p/7134531.html