Char-Pointer Vergleich bringt Error

Gast #5612
Lesenswert?

Hi!

Und wieder mal ein Fehler bei dem ich nicht weiterkomme:

avr-gcc -c -g  -Os -Wall -Wstrict-prototypes -Wa,-ahlms=logpro.lst 
-mmcu=at90s2313 -I. logpro.c -o logpro.o
avr-gcc  logpro.o   -Wl,-Map=logpro.map,--cref -lm -mmcu=at90s2313 -o 
logpro.elf
D:\avrgcc\bin\..\lib\gcc-lib\avr\3.0.2\..\..\..\..\avr\bin\ld.exe: 
region text is full (logpro.elf section .text)
make: *** [logpro.elf] Error 1

Den Error zeigt der Compiler mir an, sobald ich folgenden Code im 
Programm stehen habe, der aber syntaktisch korrekt sein müsste.

while(gpsptr1 != gpsptr2)
{
  ...
}

gpsptr1 und gpsptr2 sind folgendermaßen deklariert und definiert:

char *gpsptr1, *gpsptr2;

gpsptr1 = strchr(gpsstring, ',');
gpsptr1++;
gpsptr2 = strchr(gpsptr1, ',');

Ich hoffe es kann mir einer weiterhelfen ...
Gast #5614
Lesenswert?

>> ld.exe: region text is full (logpro.elf section .text)
>heißt das nicht, daß der Speicher voll ist?

In der Tat - Folgendes habe ich im Usenet dazu noch gefunden:

This error means just what it says -- your text section is full,
i.e. the code space of the AVR is all used up.

Some suggestions:

1. Try to compile with -Os (to optimize for size)

2. Reduce your code size:
   a. Don't use floating point
   b. Minimize the use of initialized data
   c. Avoid using global or static variables (I've found that copying
      a global to a local variable in a function, doing my operations
      on it and then copying back will drastically reduce code
      size. It seems avr-gcc 3.0.X treats every global as 'volatile').
   d. Use smaller algorithms
   e. Remove features

3. Get an AVR with larger flash

--

Punkt 1 habe ich vorher auch schon gemacht. Die Punkte unter 2 habe ich 
im wesentlichen auch gemacht (bis auf das entfernen von Features ... ich 
kann nämlich keine entfernen, im Gegenteil das Programm ist noch 
nichtmal vollständig :P)

Daher bleibt wohl nichts anderes übrig auf einen anderen AVR zu 
verwenden. Derzeit verwende ich den AT90S2313. Mal schauen was wir in 
unsere Box alternativ bauen können, mit mehr Flash.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren