ARM:arm-none-eabi-gcc无法识别汇编程序 [英] ARM: arm-none-eabi-gcc can't recognize assembler

查看:389
本文介绍了ARM:arm-none-eabi-gcc无法识别汇编程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过Makefile编译项目会产生全部错误.

Compiling the project through Makefile gives full set of errors.

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 

我看到其他线程也遇到这种问题,但是错误仅出现在单行中.在这里,我们可以看到总错误.我错过了什么吗?

I saw other threads with this kind of problem, but errors there was just in single lines. Here we can see total error. Have i missed something?

推荐答案

看起来您正在尝试将要与eabi-gcc工具链一起用于其他编译器(在本例中为IAR)一起使用的启动文件.显然,正如您可能已经发现的那样,它是行不通的.您可以通过几种方法来完成这项工作,其中包括学习启动文件的工作方式以及如何编写可由gcc工具链正确理解的启动文件,以查找已经用于gcc工具链的启动文件. .

Looks like you are trying to use a startup file that is meant to be used with some other compiler (in this case IAR) with eabi-gcc tool-chain. Obviously, as you may have already found out, it will not work. There are few options for you to make this work, in which includes to learn how the startup file works and how you write a startup file that can be correctly understood by a gcc toolchain to find a startup file that has been already used for gcc toolchain.

也许,为了使事情顺利进行,我认为您应该从最简单的选项开始,在该选项中找到与gcc工具链一起使用的启动文件.

Perhaps, to get the things going, I think you should start with the easiest option, in which find a startup file that works with gcc toolchain.

为此,我建议从此处下载和安装Atollic True Studio,然后使用他们的启动文件之一作为目标. Atollic是基于gnu的工具链,但是,出于您自己的目的,可能会提取启动文件.这些启动文件可以与任何基于gcc的工具链一起使用(在您的情况下为eabi).对于某些库,ST还提供了这些启动文件,因此不要使用iar的启动文件,而要使用基于gcc的启动文件之一.

For this, I would recommend to download/install Atollic True Studio from here and use one of their startup files for your target. Atollic is a gnu based toolchain, however, and startup files may be extracted for your own purpose. Those startup files can be used with any gcc based toolchain, in your case eabi. With some libraries, ST also provides these startup files, so do not use the iar one, but use one of those gcc based ones.

这篇关于ARM:arm-none-eabi-gcc无法识别汇编程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆