通过Makefile编译该项目会产生全套错误。
D:\projects\UVS-JK(132x64)>mingw32-make
arm-none-eabi-gcc -mcpu=cortex-m4 -std=c99 -mthumb -mlittle-endian -mfpu=fpv4-sp
-d16 -mfloat-abi=hard -mthumb-interwork -Os -DUSE_STDPERIPH_DRIVER -DSTM32F1
0X -DMANGUSTA_DISCOVERY -DUSE_USB_OTG_FS -DHSE_VALUE=8000000 -I./inc -I./.\libra
ries\CMSIS\CM3\CoreSupport -I./ -I./inc/ -Wl,-T,stm32_flash.ld src/main.c uc16
01s/uc1601s.c startup/startup_stm32f10x_cl.s -o demo.elf
startup/startup_stm32f10x_cl.s: Assembler messages:
startup/startup_stm32f10x_cl.s:1: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:2: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:3: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:4: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:5: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:6: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:7: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:8: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:9: Error: junk at end of line, first unrecognized
character is `*'
startup/startup_stm32f10x_cl.s:10: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:11: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:12: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:13: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:14: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:15: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:16: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:17: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:18: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:19: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:20: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:21: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:22: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:23: Error: junk at end of line, first unrecognize
d character is `*'
startup/startup_stm32f10x_cl.s:26: Error: bad instruction `the modules in this f
ile are included in the libraries,and may be replaced'
startup/startup_stm32f10x_cl.s:27: Error: bad instruction `by any user-defined m
odules that define the PUBLIC symbol _program_start or'
startup/startup_stm32f10x_cl.s:28: Error: bad instruction `a user defined start
symbol.'
startup/startup_stm32f10x_cl.s:29: Error: bad instruction `to override the cstar
tup defined in the library,simply add your modified'
startup/startup_stm32f10x_cl.s:30: Error: bad instruction `version to the workbe
nch project.'
startup/startup_stm32f10x_cl.s:32: Error: bad instruction `the vector table is n
ormally located at address 0.'
startup/startup_stm32f10x_cl.s:33: Error: bad instruction `when debugging in RAM
,it can be located in RAM,aligned to at least 2^6.'
startup/startup_stm32f10x_cl.s:34: Error: bad instruction `the name "__vector_ta
ble"has special meaning for C-SPY:'
startup/startup_stm32f10x_cl.s:35: Error: condition required -- `it is where the
SP start value is found,and the NVIC vector'
startup/startup_stm32f10x_cl.s:36: Error: bad instruction `table register(VTOR)i
s initialized to this address if!=0.'
startup/startup_stm32f10x_cl.s:38: Error: bad instruction `cortex-M version'
startup/startup_stm32f10x_cl.s:41: Error: bad instruction `module ?cstartup'
startup/startup_stm32f10x_cl.s:43: Error: bad instruction `forward declaration o
f sections.'
startup/startup_stm32f10x_cl.s:44: Error: bad instruction `section CSTACK:DATA:N
OROOT(3)'
startup/startup_stm32f10x_cl.s:46: Error: bad instruction `section .intvec:CODE:
NOROOT(2)'
startup/startup_stm32f10x_cl.s:48: Error: bad instruction `extern __iar_program_
start'
startup/startup_stm32f10x_cl.s:49: Error: bad instruction `extern SystemInit'
startup/startup_stm32f10x_cl.s:50: Error: bad instruction `public __vector_table
'
startup/startup_stm32f10x_cl.s:52: Error: bad instruction `data'
startup/startup_stm32f10x_cl.s:53: Error: bad instruction `__vector_table'
startup/startup_stm32f10x_cl.s:54: Error: bad instruction `dcd sfe(CSTACK)'
startup/startup_stm32f10x_cl.s:55: Error: bad instruction `dcd Reset_Handler'
startup/startup_stm32f10x_cl.s:55: Error: bad instruction `reset Handler'
startup/startup_stm32f10x_cl.s:56: Error: bad instruction `dcd NMI_Handler'
startup/startup_stm32f10x_cl.s:56: Error: bad instruction `nmi Handler'
startup/startup_stm32f10x_cl.s:57: Error: bad instruction `dcd HardFault_Handler
'
startup/startup_stm32f10x_cl.s:57: Error: bad instruction `hard Fault Handler'
startup/startup_stm32f10x_cl.s:58: Error: bad instruction `dcd MemManage_Handler
'
startup/startup_stm32f10x_cl.s:58: Error: bad instruction `mpu Fault Handler'
startup/startup_stm32f10x_cl.s:59: Error: bad instruction `dcd BusFault_Handler'
startup/startup_stm32f10x_cl.s:59: Error: bad instruction `bus Fault Handler'
startup/startup_stm32f10x_cl.s:60: Error: bad instruction `dcd UsageFault_Handle
r'
startup/startup_stm32f10x_cl.s:60: Error: bad instruction `usage Fault Handler'
startup/startup_stm32f10x_cl.s:61: Error: bad instruction `dcd 0'
startup/startup_stm32f10x_cl.s:61: Error: bad instruction `reserved'
startup/startup_stm32f10x_cl.s:62: Error: bad instruction `dcd 0'
startup/startup_stm32f10x_cl.s:62: Error: bad instruction `reserved'
startup/startup_stm32f10x_cl.s:63: Error: bad instruction `dcd 0'
startup/startup_stm32f10x_cl.s:63: Error: bad instruction `reserved'
startup/startup_stm32f10x_cl.s:64: Error: bad instruction `dcd 0'
startup/startup_stm32f10x_cl.s:64: Error: bad instruction `reserved'
startup/startup_stm32f10x_cl.s:65: Error: bad instruction `dcd SVC_Handler'
startup/startup_stm32f10x_cl.s:65: Error: bad instruction `svcall Handler'
startup/startup_stm32f10x_cl.s:66: Error: bad instruction `dcd DebugMon_Handler'
startup/startup_stm32f10x_cl.s:66: Error: bad instruction `debug Monitor Handler
'
startup/startup_stm32f10x_cl.s:67: Error: bad instructiMakefile:53: recipe for t
arget 'demo.elf' failed
mingw32-make: *** [demo.elf] Error 3
字符串
我看到其他线程有这种问题,但错误只在单行中。在这里,我们可以看到完全错误。我错过了什么吗?
2条答案
按热度按时间mm9b1k5b1#
看起来你正在尝试使用一个启动文件,该文件旨在与其他一些编译器(在本例中为IAR)一起使用eabi-gcc工具链。显然,正如你可能已经发现的那样,它不会起作用。有几个选项可以让你做到这一点,其中包括学习启动文件如何工作,以及如何编写一个gcc工具链可以正确理解的启动文件,以找到一个已经用于gcc工具链的启动文件。
也许,为了让事情继续下去,我认为你应该从最简单的选择开始,在其中找到一个与gcc工具链一起工作的启动文件。
为此,我建议从here下载/安装Atollic True Studio,并为您的目标使用他们的启动文件之一。Atollic是一个基于gnu的工具链,然而,启动文件可以被提取出来用于您自己的目的。这些启动文件可以与任何基于gcc的工具链一起使用,在你的例子中是eabi。对于一些库,ST也提供了这些启动文件,所以不要使用iar文件,而要使用基于gcc的文件。
vxf3dgd42#
STM32标准外围库软件包包含不同版本的startup_stm32f10x_cl. s文件。