Daniel O'Connor wrote:
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*
Note that if you used the WinAVR Makefile Template, or you used MFile
(available on *nix) to generate your makefile, then you wouldn't have
run into this problem as there are pre-existing targets that take care
of generating your hex file from the elf file with all the proper
command line options. It might save you some time and trouble.
--
Eric Weddington
_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat