如何解决make:*** [sdram] Eclipse的错误1

时间:2010-10-13 18:27:35

标签: eclipse build

我正在尝试在Eclipse上为我的AT91sam9260板创建一个新项目。 该项目基于两个atmel示例:basic-ssc-i2s和basic-emac-uip-telnet。

但是当我一起使用这些示例时,出现以下错误: make: * [sdram]错误1

我不知道为什么,我一直在想,我认为这是因为在Makefile文件中有一些错误!

有人可以帮助我吗?

感谢

1 个答案:

答案 0 :(得分:0)

makefile:

CHIP  = at91sam9260
BOARD = at91sam9260-ek

# Trace level used for compilation
# (can be overriden by adding TRACE_LEVEL=#number to the command-line)
TRACE_LEVEL = 4

# Optimization level, put in comment for debugging
#OPTIMIZATION = -Os

# AT91 library directory
AT91LIB = ../at91lib

# Output file basename
OUTPUT = basic-ssc-i2s-at73c213-project-$(BOARD)-$(CHIP)

# Compile for all memories available on the board (this sets $(MEMORIES))
include $(AT91LIB)/boards/$(BOARD)/board.mak

# Output directories
BIN = bin
OBJ = obj

#-------------------------------------------------------------------------------
#       Tools
#-------------------------------------------------------------------------------

# Tool suffix when cross-compiling
CROSS_COMPILE = arm-none-eabi-

# Compilation tools
CC = $(CROSS_COMPILE)gcc
SIZE = $(CROSS_COMPILE)size
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy

# Flags
INCLUDES = -I$(AT91LIB)/boards/$(BOARD) -I$(AT91LIB)/peripherals
INCLUDES += -I$(AT91LIB)/components -I$(AT91LIB) -I.

CFLAGS = -Wall -mlong-calls -mstructure-size-boundary=8 -ffunction-sections
CFLAGS += -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_LEVEL=$(TRACE_LEVEL)
ASFLAGS = -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
LDFLAGS = -g $(OPTIMIZATION) -nostartfiles -Wl,--gc-sections

#-------------------------------------------------------------------------------
#       Files
#-------------------------------------------------------------------------------

# Directories where source files can be found
PERIPH = $(AT91LIB)/peripherals
BOARDS = $(AT91LIB)/boards
UTILITY = $(AT91LIB)/utility
COMP = $(AT91LIB)/components
# uIP library directory
UIPLIB = ../external_libs/ethernet/uip

VPATH += $(COMP)/dac-at73c213
VPATH += $(COMP)/ethernet/dm9161
VPATH += $(UTILITY)
VPATH += $(PERIPH)/dbgu $(PERIPH)/pio $(PERIPH)/aic $(PERIPH)/ssc $(PERIPH)/spi $(PERIPH)/pmc
VPATH += $(PERIPH)/cp15 $(PERIPH)/emac $(PERIPH)/rstc $(PERIPH)/usart $(PERIPH)/tc
VPATH += $(BOARDS)/$(BOARD) $(BOARDS)/$(BOARD)/$(CHIP)
VPATH += $(UIPLIB)/uip
VPATH += $(UIPLIB)/lib
VPATH += $(UIPLIB)/apps/dhcpc
#VPATH += $(UIPLIB)/apps/telnetd

INCLUDES += -I$(UTILITY)
INCLUDES += -I$(UIPLIB)/uip
INCLUDES += -I$(UIPLIB)/lib
INCLUDES += -I$(UIPLIB)/apps/dhcpc
#INCLUDES += -I$(UIPLIB)/apps/telnetd


# Objects built from C source files
C_OBJECTS = main.o
C_OBJECTS += at73c213.o dm9161.o protocol.o
C_OBJECTS += wav.o stdio.o math.o emac.o rstc.o tc.o usart.o
C_OBJECTS += dbgu.o pio.o ssc.o aic.o spi.o pmc.o cp15.o
C_OBJECTS += board_memories.o board_lowlevel.o

#UIP:
#lib
C_OBJECTS += memb.o
#uip
C_OBJECTS += psock.o timer.o uip.o  uip_arp.o
#main
C_OBJECTS += clock-arch.o tapdev.o
#dhcp
C_OBJECTS += dhcpc.o
#telnetd
#C_OBJECTS += shell.o telnetd.o

# Objects built from Assembly source files
ASM_OBJECTS = board_cstartup.o
ASM_OBJECTS += cp15_asm.o

# Append OBJ and BIN directories to output filename
OUTPUT := $(BIN)/$(OUTPUT)

#-------------------------------------------------------------------------------
#       Rules
#-------------------------------------------------------------------------------

all: $(BIN) $(OBJ) $(MEMORIES)

$(BIN) $(OBJ):
    mkdir $@

define RULES
C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS))
ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))

$(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
    $(CC) $(LDFLAGS) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$$@.lds" -o $(OUTPUT)-$$@.elf $$^
    $(OBJCOPY) -O binary $(OUTPUT)-$$@.elf $(OUTPUT)-$$@.bin
    $(SIZE) $$^ $(OUTPUT)-$$@.elf

$$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
    $(CC) $(CFLAGS) -D$(1) -c -o $$@ $$<

$$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
    $(CC) $(ASFLAGS) -D$(1) -c -o $$@ $$<

debug_$(1): $(1)
    perl ../resources/gdb/debug.pl $(OUTPUT)-$(1).elf

endef

$(foreach MEMORY, $(MEMORIES), $(eval $(call RULES,$(MEMORY))))

clean:
    -rm -f $(OBJ)/*.o $(BIN)/*.bin $(BIN)/*.elf