Recently I came to know that ELF file can hold the flash, fuse/lock as well as EEPROM contents in a single file which comes handy in many cases. avr/fuse.h allows the fuse bits to be set in code. I also noticed that on compilation, the arduino IDE generated an ELF file. Is there a way to upload an ELF file directly to arduino. I tried out using AVRDUDE 6.1 which has ELF file support. I used the following command line which I got from the arduino verbose mode and replaced the hex with ELF file:
avrdude.conf -v -patmega2560 -cwiring -PCOM5 -b115200 -D -Uflash:w:"C:\Users\SREEDEV K\AppData\Local\Temp\build8313256132960870781.tmp/sketch_apr06a.cpp.elf":i
I obtained the following results as in the attached file which says that the file does not contain any hex info. So I was wondering whether I could program the fuses using avr/fuse.h and uploading the hex generated by the arduino IDE or should I go for the ELF itself. My ultimate aim is to use arduino as ISP to program the fuses of standalone microcontrollers. I think it is possible through avrdude command line, but I want to make it simpler by direct file uploading.
Hey sreedevk, the ":i" at the end of the -U parameter is specifying that it is an intel hex file format. For elf format, you could use ":e" - or omit it and just use -Uflash:w:"whatever.elf" according to the man page for avrdude
ELF file can hold the flash, fuse/lock as well as EEPROM contents in a single file
Note that bootloaders are not capable of changing fuses, and the Uno bootloader is not capable of writing EEPROM.
I have a .elf and hex file that i would like to use. I am using a Uno R3 as ISP to program a ATTINY13A and really do not want to have to rewrite the entire code just to program this chip. Is there a way to upload elf or hex to program this ATTINY13A?