avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Please help with "section .bss is not within region d


From: Uwe Bonnes
Subject: Re: [avr-gcc-list] Please help with "section .bss is not within region data" error
Date: Tue, 24 Apr 2001 15:17:37 +0200

>>>>> "Molnar" == Molnar Zoltan <address@hidden> writes:

    Molnar> Hi!  I'm wondering if anybody has seen this problem: I have the
    Molnar> following type declaration: #define FIFOlgth 2048 typedef struct
    Molnar> { u16 min,max,o,f; bool isfull; u08 data[FIFOlgth]; } t_fifo;
    Molnar> The problem is if I want to declare a global variable like this:
    Molnar> t_fifo fifo; int main (void) { ....  }

Do you have external ram? The chip itself has only limited ram and only
ATMEGA103 has more than 2048 bytes. So it si too small.

    Molnar> The make process returns with error (I enclose the compile/link
    Molnar> flags too):

...
    Molnar> make: *** [test.elf] Error 1 If I put the declaration in the
    Molnar> main function like this: int main (void) { t_fifo fifo; ....  }
    Molnar> it compiles OK.  

Defining the variable inside a function makes a stack variable. Obviously
the stack isn't checked, and so corruption would be silent, as there isn't
enough room...

If you have external ram, place the varialle at the start of available
external ram (remember that the internal ram and the ports also use address
space in ram) like

t_fifo fifo = 0x1000;

Bye
-- 
Uwe Bonnes                address@hidden

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]