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*