# AVR studio flash file annoyance

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?

• Is there a reason you want to use the hex file instead of ELF? My understanding is that the debug info gets stripped during programming so it shouldn't really make a difference. – PeterJ Nov 1 '13 at 12:37
• I thought an ELF file was like a Windows PE file? Surely there's no way my ATtiny can run an ELF file with all the headers and crap that's in there? – David Högberg Nov 1 '13 at 12:52
• I don't have a programmer attached to my PC at the moment to try it but my understanding is the ELF contains the binary code and fuse settings along with debug information but the latter isn't actually programmed into the device. If you've got it all setup maybe give it a try and see how it goes. I've only used V6 for one project so far and that was previously under V5 so maybe I didn't have to change it because of some other default that carried across. – PeterJ Nov 1 '13 at 13:04
• I just tried it and it runs fine with the ELF file. Very strange. Just look at all the headers that are in an ELF file: en.wikipedia.org/wiki/Executable_and_Linkable_Format – David Högberg Nov 1 '13 at 13:11
• As far as I know there is no "AVR Studio 6" - Atmel has renamed AVR Studio to "Atmel Studio 6." If you're using version 6, I'm fairly certain you're using Atmel Studio 6. – JYelton Nov 1 '13 at 23:44

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.