Every time I want to program my ATtiny85 using AVR Studio 6 it has the MyProject.elf file pre-selected in the "Flash" drop-down box in the Device Programming dialog. Obviously I want it to program the MyProject.hex file, but I manually have to select this every time using the drop-down list. Does anyone know a trick to get my selection to stick?
According to the What is ELF file and how to program it on the AVR devices? support FAQ at Atmel the following is given as a difference:
The difference is when you generate it in AVR Studio you can save the file with data like EEPROM, FLASH, FUSE SETTINGS and LOCK BITS. But the same ELF file, if it is generated through compiler then it contains debugging with source code property along with all we mentioned before. The generated ELF file can be specified as input to the programming dialog so that all contents of the file is programmed in one operation.
Opening up an ELF file I have for an ATtiny85 project it is a total of 386 kB in size and does contain debugging information including the full symbol table and location of all the source code files, but that is skipped during device programming.
There are a number of ELF file viewers available and if you install one and examine the file you'll see that while complex in one way they are broken into a number of sections, so it'd be easy for the programming phase to only use the relevant parts to program the device.
The flash and EEPROM in an AVR MCU need to be programmed separately. Using the ELF has the advantage of including both pieces in the same file, whereas 2 HEX files are required for the same operation and both would need to be specified separately. Obviously if you aren't using
EEMEM then there isn't an awful lot of difference, but it is convenient when you are.