[Top][All Lists]

[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

From: Kang Tin LAI
Subject: Re: [avr-gcc-list] Please help with "section .bss is not within region data" error
Date: Tue, 24 Apr 2001 22:31:27 +0800


Check the file gcrt1.S in libc sources, there is a description telling
you how to setup the MCUCR and WDTCR before jumping to main() - your

For 8515, there are only 2 control registers - MCUCR and WDTCR
available for you to setup at link time, add linker flags as follows:

                --defsym __init_mcucr__=0xc0
                --defsym __init_wdtcr__=0x00 --defsym __stack=0x7fff

For my __init_mcucr__, 0xc0 = enable external SRAM and 1 wait state.
(1 wait state is for my slow response memory mapped LCD, if SRAM only,
0 wait state should not be a problem for "modern" SRAM, i.e 0x80)



Molnar Zoltan wrote:
> Hi!
> I'm wondering if anybody has seen this problem:
> I have the following type declaration:
> #define FIFOlgth 2048
> typedef struct {
> u16 min,max,o,f;
> bool isfull;
> u08 data[FIFOlgth];
> } t_fifo;
> The problem is if I want to declare a global variable like this:
> t_fifo fifo;
> int main (void)
> {
> ....
> }
> The make process returns with error (I enclose the compile/link flags too):
> avr-gcc -c -g -O2 -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst 
> -mmcu=at90s8515 -I. test.c -o test.o
> avr-gcc test.o -Wl,-Map=test.map,--cref -mmcu=at90s8515 -o test.elf
> D:\AVRGCC\BIN\..\lib\gcc-lib\avr\2.95.2\..\..\..\..\avr\bin\ld.exe: address 
> 0x869 of test.elf section .bss is not within region data
> make: *** [test.elf] Error 1
> If I put the declaration in the main function like this:
> int main (void)
> {
> t_fifo fifo;
> ....
> }
> it compiles OK.
> I need the variable to be global, I have to access it from interrupts.
> ----------------
> How can I initialize the stack pointer and MCUCR at compile time?
> I have read something about --defsym but I don't know where to put and how. 
> In the compiler flags or the linker flags?
> What's the syntax using --defsym
> Any help would be welcomed
> Thanks
> PS: I'm using avr-gcc 2.95, but I tryed with 2.97, 3.1 with the same result.
> _____________________________________________________________
> Are you a Techie? Get Your Free Tech Email Address Now! Visit 
> http://www.TechEmail.com
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list

reply via email to

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