Ich habe den avr-gcc nach dieser anleitung installiert:
http://www.linuxfocus.org/Deutsch/No...ml#352lfindex3
und zum kompilieren die Makefile aus dem mega8ledtest programm für mich angepasst.
Makefile:
Mein Source und die o.g. Makefile liegt in meinem Home dir gemeinsam mit dem dir AVR in welchem sich alle AVR Header befinden.Code:# makefile, written by guido socher MCU=atmega16 CC=avr-gcc OBJCOPY=avr-objcopy # optimize for size: CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues #------------------- all: test.hex #------------------- help: @echo "Usage: make all|load|load_pre|rdfuses|wrfuse1mhz|wrfuse4mhz|wrfusecrystal" @echo "Warning: you will not be able to undo wrfusecrystal unless you connect an" @echo " external crystal! uC is dead after wrfusecrystal if you do not" @echo " have an external crystal." #------------------- test.hex : test.out $(OBJCOPY) -R .eeprom -O ihex test.out test.hex test.out : test.o $(CC) $(CFLAGS) -o test.out -Wl,-Map,test.map test.o test.o : test.c $(CC) $(CFLAGS) -Os -c test.c #------------------ load: test.hex ./prg_load_uc test.hex # here is a pre-compiled version in case you have trouble with # your development environment load_pre: test_pre.hex ./prg_load_uc test.hex # loaduisp: test.hex ./prg_load_uc -u test.hex # here is a pre-compiled version in case you have trouble with # your development environment load_preuisp: test_pre.hex ./prg_load_uc -u test.hex #------------------- # fuse byte settings: # Atmel AVR ATmega8 # Fuse Low Byte = 0xe1 (1MHz internal), 0xe3 (4MHz internal), 0xe4 (8MHz internal) # Fuse High Byte = 0xd9 # Factory default is 0xe1 for low byte and 0xd9 for high byte # Check this with make rdfuses #rdfuses: ./prg_fusebit_uc -r # use internal RC oscillator 1 Mhz #wrfuse1mhz: ./prg_fusebit_uc -w 1 # use internal RC oscillator 4 Mhz #wrfuse4mhz: ./prg_fusebit_uc -w 4 # use external 3-8 Mhz crystal # Warning: you can not reset this to intenal unless you connect a crystal!! #wrfusecrystal: # @echo "Warning: The external crystal setting can not be changed back without a working crystal" # @echo " You have 3 seconds to abort this with crtl-c" # @sleep 3 # ./prg_fusebit_uc -w 0 #------------------- clean: rm -f *.o *.map *.out *t.hex #-------------------
Die Sourcedatei sieht folgendermassen aus:
...hat also erst mal keine Funktion aber es geht ja darum den Kompiler in betrieb zu bekommen.Code:#include "avr/io.h" int main(void) { }
wennn ich jetzt make aufrufe kommt folgende Fehlermeldung:
Aus irgentwelchen Gründen können wohl die Header nicht gefunden/darauf zugegriffen werden aber die sind doch vorhanden.make
avr-gcc -g -mmcu=atmega16 -Wall -Wstrict-prototypes -Os -mcall-prologues -Os -c test.c
In file included from test.c:1:
avr/io.h:86:26: error: avr/sfr_defs.h: No such file or directory
avr/io.h:216:25: error: avr/iom16.h: No such file or directory
avr/io.h:304:26: error: avr/portpins.h: No such file or directory
avr/io.h:314:25: error: avr/version.h: No such file or directory
make: *** [test.o] Error 1
Danke schon im vorraus für eure Bemühungen.







Zitieren

Lesezeichen