avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Problems with char */arrays


From: Rick Altherr
Subject: Re: [avr-libc-dev] Problems with char */arrays
Date: Mon, 10 Dec 2007 14:36:57 -0800


On Dec 10, 2007, at 2:08 PM, Taj Morton wrote:

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
avr-objcopy -j .text -j .data -O ihex gyro.elf gyro.hex
avrdude -V -p m128 -c avrispmkII -P usb -e -U flash:w:gyro.hex

The vars aren't filled with just 0xFF...it seems more like "random" data.

- Taj

--
Taj
http://www.wildgardenseed.com/Taj/blog

Need a GMail invite? Email me.
Peace cannot be kept by force; it
can only be achieved by understanding.
               -- A. Einstein


_______________________________________________
AVR-libc-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev


Any reason you aren't using the -mmcu=atmega128 option to avr-gcc?

--
Rick Altherr
address@hidden

"He said he hadn't had a byte in three days. I had a short, so I split it with him."
 -- Slashdot signature


Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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