hallo,
jetzt kopiere ich den code mal rein (ich finde aber keine abweichung).
ich lasse mal alles andere stehen:
int main(void)
{
uint8_t ivar;
uint16_t i;
uint16_t j;
uint16_t k;
char ic[] = "abcd";
char ic2[] = "dcba";
unsigned char my_string[]="123";
//*************** the global init
init();
lcd_setadress(0,0);
//my_string[40]="Hallo";
//strcpy(my_string, "test");
//lcd_stringr(my_string);
//lcd_writechar(97);
// if(ic[0]!='a') lcd_writechar(98);
//if(ic[0]=='a') lcd_writechar(97);
for(i=0;i<4;i++)
{
if(ic[i] == ic2[i]){
lcd_writechar(97);
}
}
}
unten steht mein makefile.
die objcopy zeile sieht so aus:
${OBJCOPY} -j .text -O ihex ${OBJDIR}/${PROJNAME}.out \
${BINDIR}/${BINNAME}
also nix von .data.
wie müsste denn das aussehen? ich muss aus dem gleichen .out file
.text und .data rauskopieren richtig?
danke
alex
#
SHELL=/bin/sh
COMPILER=avr-gcc
ASSEMBLER=avr-as
#ASM with cpp
ASSEMBLER=avr-gcc
MMCU=atmega32
#the asm flags
ifeq (${ASSEMBLER},avr-as)
AFLAGS=-mmcu=${MMCU} \
-I ${SRCDIR} \
# --gstabs \
# -Os
endif
ifeq (${ASSEMBLER},avr-gcc)
AFLAGS=-mmcu=${MMCU} \
-c \
-x assembler-with-cpp \
-I ${SRCDIR} \
-Os \
# -Wa,-gstabs
endif
#the compiler flags
ifeq (${COMPILER},avr-gcc)
FLAGS=-mmcu=${MMCU} \
-Os \
-c \
# -g
endif
#----------- NO USER-INPUT NEEDED HERE ----------------------------
#the asm command
ifeq (${COMPILER},avr-gcc)
ASSEMBLE=${ASSEMBLER} ${AFLAGS}
endif
#the compile command
ifeq (${COMPILER},avr-gcc)
COMPILE=${COMPILER} ${FLAGS}
endif
#the link command
ifeq (${COMPILER},avr-gcc)
LINK=${COMPILER} -mmcu=${MMCU}
endif
#------------------------------------------------------------------
#____________________ DIRECTORIES __________________
#___________________________ root directory of the SESM distribution
ROOTDIR=./
#___________________________ path to the object files
BINDIR=${ROOTDIR}bin
#___________________________ path to the object files
OBJDIR=${ROOTDIR}bin/obj
#___________________________ path to the object files
SRCDIR=${ROOTDIR}src
#_______________________________________________________________________
_
#____________________ ADDITIONAL LIBRARIES __________________
LLIBS=
OBJCOPY=avr-objcopy
#the objects to compile/link
OBJ = main.o \
s1d1565.o \
#the assembler sources
ASM= lib_eybasm.o \
#name of the final binary
PROJNAME=eyb
BINNAME=${PROJNAME}.hex
#define the path for the obj files:
vpath %.o ${OBJDIR}
#_____________________ the targets _______________________
default: shift ${BINDIR}/${BINNAME}
#the bin target (depends on all obj)
${BINDIR}/${BINNAME}: ${OBJDIR}/${PROJNAME}.out
@echo
"---OBJCOPY-----------------------------------------------------------"
${OBJCOPY} -j .text -O ihex ${OBJDIR}/${PROJNAME}.out
${BINDIR}/${BINNAME}
@echo
"---------------------------------------------------------------------"
@echo " "
#linker
${OBJDIR}/${PROJNAME}.out: ${ASM} ${OBJ}
@echo
"---LINKER------------------------------------------------------------"
${LINK} -o ${OBJDIR}/${PROJNAME}.out
-W1,-Map,${OBJDIR}/${PROJNAME}.map $(patsubst %.o,${OBJDIR}/%.o,$(OBJ))
$(patsubst %.o,${OBJDIR}/%.o,$(ASM)) ${LLIBS}
@echo
"---------------------------------------------------------------------"
@echo " "
#the object targets (% means all) (depend on the source code)
#this compiles the *.c --> *.o (only those in OBJ-list)
${OBJ}: %.o: ${SRCDIR}/%.c
@echo
"---COMPILER----------------------------------------------------------"
${COMPILE} -o ${OBJDIR}/$@ ${SRCDIR}/$*.c
@echo
"---------------------------------------------------------------------"
@echo " "
#the asm targets (% means all) (depend on the source code)
#this compiles the *.S --> *.o (only those in ASM-list)
${ASM}: %.o: ${SRCDIR}/%.S
@echo
"---ASSEMBLER---------------------------------------------------------"
${ASSEMBLE} -o ${OBJDIR}/$@ ${SRCDIR}/$*.S
@echo
"---------------------------------------------------------------------"
@echo " "
flash: ${BINDIR}/${BINNAME}
@echo
"---FLASH-------------------------------------------------------------"
#avrdude -P /dev/ttyUSB0 -c stk500v2 -p m32 -U
flash:w:${BINDIR}/${BINNAME}
avrdude -V -P /dev/ttyUSB0 -c stk500v2 -p m32 -U
flash:w:${BINDIR}/${BINNAME}
@echo
"---------------------------------------------------------------------"
@echo " "
new: shift clean default
clean:
@echo
"---CLEAN-------------------------------------------------------------"
rm -rf ${OBJDIR}/*.o
rm -rf ${BINDIR}/${BINNAME}
rm -rf ${SRCDIR}/*~
@echo
"---------------------------------------------------------------------"
@echo " "
shift:
@echo " "
@echo " "
@echo " "
@echo " "
terminal:
@echo
"---TERMINAL------------------------------------------------------------
-"
@echo "use 'r xfuse'"
avrdude -P /dev/ttyUSB0 -c stk500v2 -p m32 -t
@echo
"---------------------------------------------------------------------"
@echo 'use the following command to flash the fuse'
@echo 'avrdude -P /dev/ttyUSB0 -c stk500v2 -p m32 -U xfuse:w:0xii:m
'
@echo " "