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

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

[avr-gcc-list] internal error: out of range error


From: Dafni & Robert Berger
Subject: [avr-gcc-list] internal error: out of range error
Date: Thu, 2 Sep 2004 21:45:35 +0300

Hi all,

I am hitting the famous "out of range error", cause by an odd number of data
bytes inserted in the .text section.

This innocent line of code, which tries to put some version info into ROM
causes the error:

const char      max7219_C_VER[] PROGMEM = "@(#) $Id: max7219.c,v 0.0
2004/01/25 18:58:09Dafni Exp $";

I am searching for the correct way to use __attribute__ ((aligned
(something))) to heal the problem.

So far I tried unsuccessfully:

const char      max7219_C_VER[] __attribute__ ((aligned(1))) PROGMEM = "@(#)
$Id: max7219.c,v 0.0 2004/01/25 18:58:09Dafni Exp $";
const char      max7219_C_VER[] __attribute__((__progmem__))  __attribute__
((__aligned__(1))) = "@(#) $Id: max7219.c,v 0.0 2004/01/25 18:58:09Dafni Exp
$";

and so on...

If I do the following:

const char      max7219_C_VER[] __attribute__((__progmem__))  __attribute__
((__aligned__(2))) = "@(#) $Id: max7219.c,v 0.0 2004/01/25 18:58:09Dafni Exp
$";

I get the following in addition to the "out of range error":

F:/projects/undercvs/bergomat/src/max7219/max7219.c:79: warning: alignment
of 'max7219_C_VER' is greater than maximum object file alignment.  Using 1

I'm compiling my file as follows:

Compiling F:\projects\undercvs\bergomat\src\max7219/max7219.c
avr-gcc -c
F:/projects/undercvs/bergomat/src/max7219/max7219.c -DGCC_VER_GEQ_330=1 -gdw
arf-2 -Wall -Wstrict-prototypes -Wa,-ahlms=F:\projects\undercvs\bergomat/lst
/max7219.lst -mmcu=atmega128  -DGCC_VER_341 -D__AVR_GCC__  -g -O2  -DEXTMEM 
-DSCH20030501 -DST_5510 -DARCHITECTURE_AVR128_UCOSII -D__DEBUG__    -IF:\pro
jects\undercvs\bergomat\src\max7219 -IF:/projects/undercvs/bergomat/include 
-IF:/projects/undercvs/bergomat/config/chip
-IF:/projects/undercvs/bergomat/config/board -IF:/projects/undercvs/bergomat
/config/platform  -o max7219.elf

This file will be a library:

avr-ld -r -TF:/projects/undercvs/bergomat/config/atmega128_341.xr
max7219.elf  -o libmax7219.a

The testcase, which causes the problem is built as follows:

avr-gcc  -TF:/projects/undercvs/bergomat/config/atmega128_341.x  -Wl,-Map=ma
x7219_test.elf.map,--cref -mmcu=atmega128 -o max7219_test.out
max7219_test.elf -LF:/projects/undercvs/bergomat/lib  -lboardinit -lcomm -lu
cos_ii -lmax7219

I tried also to put the string, which is want to flash to put into a
dedicated section by modifying the linker script(s) and using the
__section__ stuff, but was not successful as well.

I'm using WinAVR-20040720, but tried also older versions, which give the
same error.

Did someone have a similar problem and a solution?

I know, that just be removing the line everything works fine, but I find it
very convenient to be able to run the ident tool on my objects, libraries
and especially executables and see version info.

Regards,

Robert

----------------------------------------------------------------------------
Dafni & Robert Berger
Pharmacist & Embedded Systems SW Engineer Stratigou Rogakou 24
GR-15125 - Polydrosso - Maroussi
Athens - Greece
Tel.: (+30 210) 6847881
Fax.:(+30 210) 6847881
email: address@hidden
URL: users.hol.gr/~dafniz
"Software development is like making a baby... You can't make a baby in one
month by impregnating nine women."

"Giving up on assembly language was the apple in our Garden of Eden:
Languages whose use squanders machine cycles are sinful."
(Epigrams in Programming,  ACM SIGPLAN Sept. 1982)




reply via email to

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