Hallo,
ich verzweifle nun schon an einem einfachen Programm, das einfach nur
ein Byte aus dem EEPROM eines ATmega8 lesen und wieder reinschreiben
soll:
1 | #include <avr/io.h>
|
2 | #include <avr/eeprom.h>
|
3 |
|
4 |
|
5 | uint8_t eeModus EEMEM = 0;
|
6 | uint8_t b;
|
7 |
|
8 | int main(void)
|
9 | {
|
10 | eeModus = 5;
|
11 | b = eeprom_read_byte(&eeModus);
|
12 |
|
13 | b++;
|
14 |
|
15 | eeprom_write_byte(b, &eeModus);
|
16 |
|
17 | while(1)
|
18 | {
|
19 |
|
20 | };
|
21 |
|
22 | return 0;
|
23 | }
|
Dabei spuckt mir der Compiler das hier aus:
1 | avr-gcc -Wall -mmcu=atmega8 -DF_CPU=1000000UL -mmcu=atmega8 -Os -c -g -Os -w -ffunction-sections -fdata-sections -std=c99 -I/usr/lib/avr/include -c main.c -o obj/Debug/main.o
|
2 | avr-g++ -L/usr/lib/avr/lib -o bin/Debug/M8_EEPROM.elf obj/Debug/main.o -mmcu=atmega8 -Wl,-Map=bin/Debug/M8_EEPROM.elf.map,--cref -mmcu=atmega8 -Wl,-Map=bin/Debug/M8_EEPROM.elf.map,--cref
|
3 | obj/Debug/main.o: In function `main':
|
4 | ..../main.c:11: undefined reference to `__eerd_byte_m8'
|
5 | ..../main.c:15: undefined reference to `__eewr_byte_m8'
|
6 | collect2: ld returned 1 exit status
|
Ich kompiliere mit Code::Blocks (10.05) und:
AVR-GCC: 4.5.3
avr-libc: 1.7.1
Wäre wirklich gut, wenn ich dank euch endlich mein Problem lösen könnte
;-)
Ich danke euch schonmal!