On Fri, 9 Dec 2005 16:07, Ian Caddy wrote:
> Your problem is that you need to also include your initialised data
> section in your hex file.  The initialised data will be copied to your
> data section by the startup code, but only if you include it in your hex
> file which you are not.
>
>  > avr-objcopy -j .text -O ihex testcase.elf testcase.hex
>
> You are only including the .text section.
>
> Because of this, the initilised data section is empty (0xFF) and these
> values are copied to the data section on startup.

Doh!

>  > avr-objcopy -O ihex testcase.elf testcase.hex
>
> should work for you as it will copy the sections that it thinks it
> should rather than you telling it to just use the .text section with the
> -j field.
>
> I hope this helps,

Ahah! Thanks!
Actually I had to do "-j .text -j .data -j .bss" and it worked otherwise 
avrdude complained about addresses being out of range.

*does the happy dance*

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Attachment: pgpzRSl9fAn8A.pgp
Description: PGP signature

_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to