Undefined symbol SystemInit(referred from startup_stm32f2xx.o) while building using Keil STM32

浪尽此生 提交于 2019-12-14 03:43:12

问题


I am using STM32F207VC controller. and I am using uvision4 IDE, When I try to compile a simple code, I get the error tst1.axf: Error: L6218E: Undefined symbol SystemInit (referred from startup_stm32f2xx.o). . I have place stm32f2x file to my project directory.

But still the same problem.

Please help in resolving this.

Thanks


回答1:


"Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c" is needed it be added, as SystemInit() is defined within it.




回答2:


Well, you should define (or take it from somewhere) function SystemInit, since it is called from startup.s file.

Or you can comment lines in startup file, where SystemInit function is called. There will be something like:

1 IMPORT  SystemInit
2 IMPORT  __main
3 LDR     R0, =SystemInit
4 BLX     R0
5 LDR     R0, =__main
6 BX      R0

You can comment lines 1,3,4 with ; symbol.

Actually, function SystemInit usually is part of STM Peripheral library and it's aimed to initialize all periphery that you need. Without it, you'll have to do initialization yourself.




回答3:


May be it is too late, but: You should check Keil uVision installation folder and there are files with SystemInit function on board for all (I hope) vendors:)

~\Keil\ARM\Startup\ST\STM32F2xx\system_stm32f2xx.c



来源:https://stackoverflow.com/questions/12889732/undefined-symbol-systeminitreferred-from-startup-stm32f2xx-o-while-building-us

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!