[Top][All Lists]

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

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

From: E. Weddington
Subject: Re: [avr-gcc-list] internal error: out of range error
Date: Thu, 02 Sep 2004 13:34:56 -0600
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Dafni & Robert Berger wrote:

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 $";

AFAIK, an odd number of bytes inserted in the .text section, such as adding a PROGMEM string above, shouldn't cause that error.

And, your line of code above looks good to me (assuming that the email client wrapped the line) and it builds fine for me on a mega128 with WinAVR 20040404.

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

You shouldn't have to futz around with any alignment.

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 don't see anything obvious jumping out at me in the above.

Could you post the actual compiler error? I assume that it refers to the line that you mentioned above.


reply via email to

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