簡體   English   中英

ARM:arm-none-eabi-gcc無法識別匯編程序

[英]ARM: arm-none-eabi-gcc can't recognize assembler

通過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 

我看到其他線程也遇到這種問題,但是錯誤僅在一行中出現。 在這里,我們可以看到總錯誤。 我錯過了什么嗎?

看起來您正在嘗試使用要與eabi-gcc工具鏈一起用於某些其他編譯器(在本例中為IAR)一起使用的啟動文件。 顯然,正如您可能已經發現的那樣,它將不起作用。 您可以通過幾種方法來完成這項工作,其中包括學習啟動文件的工作方式以及如何編寫可由gcc工具鏈正確理解的啟動文件,以查找已經用於gcc工具鏈的啟動文件。 。

也許,為了使事情順利進行,我認為您應該從最簡單的選項開始,在該選項中找到與gcc工具鏈一起使用的啟動文件。

為此,我建議從此處下載/安裝Atollic True Studio,並使用其啟動文件之一作為目標。 Atollic是基於gnu的工具鏈,但是,出於您自己的目的,可能會提取啟動文件。 這些啟動文件可以與任何基於gcc的工具鏈一起使用,在您情況下為eabi。 對於某些庫,ST還提供了這些啟動文件,因此不要使用iar的啟動文件,而要使用基於gcc的啟動文件之一。

STM32 Std Periphiral Library軟件包具有不同版本的startup_stm32f10x_cl.s文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM