ADS1.2+GNUWinMake编译arm测试工程

本文详细介绍了如何在Windows环境下使用ADS1.2和GNU Make编译ARM测试工程。首先安装必要的工具,然后配置ADS工程,通过make -f ads.mk命令进行编译。在编译过程中遇到如Ambiguous section selection错误,解决办法是明确指定要保留的AREA。此外,还提供了相关配置文件的内容,包括option.inc和memcfg.inc,用于设置内存控制参数。
摘要由CSDN通过智能技术生成

首先在windows下安装make工具,并建立好ADS工程。

编译命令make -f ads.mk,执行过程请看截图http://hi.csdn.net/space-2513952-do-album-picid-507759.html

 

MYPATH = C:/boot/44b_flash
PAT = D:/Program Files/ARM/ADSv1_2/Bin
MYLDPATH = D:/arm7/lib
CC = $(PAT)/armcc
LD = $(PAT)/armlink
OBJTOOL = $(PAT)/fromelf

RM = del -f
#AS = $(PAT)/armasm -keep -g
AS = $(PAT)/armasm -keep -g
ASFILE = $(MYPATH)/SRC/44BINIT.S
CFLAGS = -O1 -g+ -Wa -DNO_UNDERSCORES=1 -I../inc


MODEL = test
#SRC = 29lv160.c 44BLIB.C 44BMAIN.C
SRC =$(wildcard *.c)
#OBJS = 29lv160.o 44BLIB.o 44BMAIN.o
DIR = $(notdir $(SRC))
OBJS_TMP = $(patsubst %.c, %.o, $(DIR)) 这里只是把.c转为.o,但.C未被转为.o
OBJS = $(patsubst %.C, %.o, $(OBJS_TMP )) 完成将.C转为.o


all:$(MODEL).axf $(MODEL).bin clean

$(MODEL).axf:$(OBJS) 44BINIT.o
    @echo "### Linking ..."
    $(LD) $(OBJS) 44BINIT.o -ro-base 0xc000000 -first 44BINIT.o(Init) -o $@ -libpath $(MYLDPATH)

#   $(LD) $(OBJS) 44BINIT.o -info totals -ro-base 0xc000000 -first 44BINIT.o(Init) -o $@ -libpath $(MYLDPATH)
#    $(LD) $(OBJS) 44BINIT.o -ro-base 0xc000000 -entry Main -first 44BINIT.o -o $@ -libpath $(MYLDPATH)


$(MODEL).bin: $(MODEL).axf
    $(OBJTOOL) -c -bin -output $@ $<
    $(OBJTOOL) -c -s -o $(<:.axf=.lst) $< 这句的意思是fromelf -c -s -o test.lst test.axf


%.o:%.c
    @echo "### Compiling $<"
    $(CC) $(CFLAGS) -c $< -o $@


%.o:%.s
    @echo "### Compiling $<"
    $(AS) $< -o $@
#    $(CC) -g -c $@ $<


clean:
    $(RM) 44BINIT.o $(OBJS)


test:
    @echo "### Just a test ###"
    @echo $(SRC)
    @echo "#######"
    @echo $(OBJS)

 

编译过程中遇到的问题及解决方案:

L6211E: Ambiguous section selection. Object <objname> contains more than one section.
This can occur when using the linker option -keep on an assembler object that contains more than

one AREA. The linker needs to know which AREA you would like to keep.
To solve this, specify the names of the AREAs that you wish to keep, using more than one -keep
option, for example: -keep boot.o(vectors) -keep boot.o(resethandler)…
Note that using assembler files with more than one AREA may give other problems elsewhere, so

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值