Home Arduino Arduino hex file location

Arduino hex file location

As an experiment I wanted to use the Arduino IDE to write code for an Attiny85, I didn’t have an ISP shield at that point and couldn’t be bothered making one but as the IDE will complie a hex file and I had a standalone programmer I decided to use that route. One problem, where is the hex file located after compiling. Also how do you setup your Arduino IDE to accept Attiny’s as a board option.

Well to use ATtinys you need to  download this zip file. Then extract the”attiny” folder and copy it to the “hardware” folder which sits under your main Arduino IDE folder. On my PC thats located at C:\Program Files (x86)\Arduino\hardware

Now restart the Arduino IDE. Next – select the board type using the Tools>Board menu. Select the appropriate ATtiny that you’re using – with the 1 MHz internal clock option. Now you can enter and compile your ATtiny sketch.

What about the hex file though, well if you select the verify option in the IDE the hex file will be produced, look at the bottom of the IDE and you will see something like this

 

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-ar rcs C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\core.a C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\WMath.cpp.o
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-ar rcs C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\core.a C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\WString.cpp.o
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -Os -Wl,–gc-sections -mmcu=attiny85 -o C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\sketch_dec11a.cpp.elf C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\sketch_dec11a.cpp.o C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\core.a -LC:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp -lm
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-objcopy -O ihex -j .eeprom –set-section-flags=.eeprom=alloc,load –no-change-warnings –change-section-lma .eeprom=0 C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\sketch_dec11a.cpp.elf C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\sketch_dec11a.cpp.eep
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-objcopy -O ihex -R .eeprom C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\sketch_dec11a.cpp.elf C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\sketch_dec11a.cpp.hex
Binary sketch size: 1,116 bytes (of a 8,192 byte maximum)

AT the bottom you will see the location of the hex file, in this example

C:\Users\iain\AppData\Local\Temp\build5383765544323063144.tmp\sketch_dec11a.cpp.hex

This is the file I used with my stand alone programmer, more details on the programmer later.

 

You may also like