[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-libc-dev] Problems with char */arrays
From: |
Weddington, Eric |
Subject: |
RE: [avr-libc-dev] Problems with char */arrays |
Date: |
Mon, 10 Dec 2007 16:58:50 -0700 |
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of Taj Morton
> Sent: Monday, December 10, 2007 3:08 PM
> To: Joerg Wunsch; address@hidden
> Subject: Re: [avr-libc-dev] Problems with char */arrays
>
> On Dec 10, 2007 8:08 AM, Joerg Wunsch <address@hidden> wrote:
> > Hard to say without seeing all the commands you invoked. My first
> > guess would be that you forgot to copy over the contents of
> .data into
> > the ROM, e.g. you used an avr-objcopy command with -j .text
> but forgot
> > to also include -j .data. That way, the initializer data for
> > initialized variables will be missing, and all your initialized
> > variables will show up with 0xff in them (as that's the
> pattern of the
> > uninitialized ROM).
> Compilation looks like this:
> avr-gcc -O -D__AVR_ATmega128__ -c gyro.c
> gcc -o gyro.elf gyro.o
Use "avr-gcc" to link, not "gcc".
As Rick Altherr said, use the -mmcu=<device name> switch on *both* your
compile command line and your linker command line.
Eric Weddington