Go Down

Topic: How to upload HEX files to Arduino Uno (Read 27631 times) previous topic - next topic


Jul 03, 2016, 04:42 pm Last Edit: Jul 04, 2016, 10:39 pm by simplex
How to upload HEX files to Arduino Uno R3

It happens that after you played for a while with an Arduino Uno R3 board, uploading various sketches written with the help of the Arduino IDE, you want to move further and flash your Uno with HEX files generated by a different IDE.
You can do this by following the steps 1-7:

(This tutorial was tested for Arduino 1.0.2 and 1.0.6 IDE)

Steps 1-4: Spying on Arduino IDE to see what command it uses to upload a hex file

1) Start the Arduino IDE.

2) Go to File -> Preferences and check Show verbose output during upload.

3) Go to File->Examples->01.Basics->Blink, and then press upload to run the Blink example.

4) At the top of the black window, that is positioned just below the source code of the Blink a LED example, you will see an avrdude command line similar to this one:

C:\Arduino102\hardware/tools/avr/bin/avrdude -CC:\Arduino102\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM3 -b115200 -D -Uflash:w:C:\Users\Usr1\AppData\Local\Temp\build1538115773179135859.tmp\Blink.cpp.hex:i

Steps 5-7: Utilizing the command to upload a non Arduino IDE hex file

5) Open the MS Windows application cmd (preferably use PowerCmd instead because it allows you to work with copy and paste like any Windows application) and copy the above mentioned command exactly as it is displayed by your Arduino IDE.

6) Replace the string between w: and :i (marked in read) with the path to your HEX file obtained using an IDE different from Arduino. If, for example, you have the file C:\uCProjects\BlinkLedBascom.hex then this is the new string that must be between w: and :i.

7 ) In PowerCmd, position the cursor just after :i and press Enter. After a short time you will finally see the message "avrdude done. Thank you." which confirms the hex file was uploaded.

As a remark, upload only hex files generated for the specific uC you have on your Arduino Uno.


This tutorial is for the particular case of Arduino 1.0.2 IDE
Why?  Even the people hesitating on all the new features are likely to be running at least 1.0.6 (the "last" 1.0.x release.)


Jul 04, 2016, 01:49 am Last Edit: Jul 04, 2016, 01:51 am by simplex
The tutorial likely applies to more recent Arduino IDE versions but as long as I verified it only on 1.0.2, I can not be 100% sure the 7 steps are identical if a different Arduino IDE is used.


The tutorial likely applies to more recent Arduino IDE versions but as long as I verified it only on 1.0.2, I can not be 100% sure the 7 steps are identical if a different Arduino IDE is used.

The point being made is that you should use one of these available downloads:


as the author, it is your responsibility to use something available.  You should validate.  Then state <whatever> and inform the reader where they can download the aforementioned IDE.



Jul 04, 2016, 10:41 pm Last Edit: Jul 04, 2016, 10:48 pm by simplex
I have just tested the tutorial for Arduino 1.0.6 IDE and it works unchanged. I updated my first post.


    Not a bad idea, but you can use Atmel studio (7) and a plugin to upload code to an arduino so long as the arduino is using an Atmel micro controller/microprocessor. Atmel Studio is also based off of Visual Studio by Microsoft so anybody who is familiar with Visual Studio will feel (sorta) at home. Plus the IDE and the plugins are both free.

    I do wish that Arduino would add an "Advanced Version" of their IDE so those who are not beginners can opt for a more "feature-packed" IDE.
"A processor is just a rock we tricked into thinking, powered by lightning"


The are alternatives for uploading HEX files to Arduino Uno, apparently, one of the most simple being XLoader. However, this small size and easy to use Windows software freezes. Personally I have not been able to work with it on my Win 7 laptop.

Also, the site of the author (http://xloader.russemotto.com/) is flooded with spam and it is not of too much use in figuring out what you have to do to make XLoader work.


@simplex: you might be interested in the following (free and open source) alternative to XLoader: ArduinoSketchUploader.

Disclaimer: I am the author of said library.


Hi All,

I'm not really one newbie in Arduino world. I've used Arduino IDE and Atmel Studio also for a while. However, can't find any situations that needs to upload only a HEX file. Anyway, this is still useful tutorial. Thanks for posting.


Here is one reason you might want to:

Your new CNC machine isn't working quite right so one of the troubleshooting steps you are directed to perform is to upload a sketch to the controller board (Arduino based) to clear your EEPROM and it is only available to download in hex format. Not that I'm going through that very thing right now :o ... Just speculating.

Oh, and I found Arduino Builder to be useful in this (hypothetical) regard.


ArduinoSketchUploader worked for me, the others did not. It overcame what seemed to be the problem: the Micro was registered as COM5, but did not respond. ArduinoSketchUploader found it as COM6 and programmed it without further complaint.


Copying the avr-dude-string and replacing long path names with 8.3-types worked for me.

To find the 8.3-name, just use cmd and do a 'dir * /x'.

This is what I ended up with: C:\Progra~1\Arduino\hardware\tools\avr/bin/avrdude -CC:\Progra~1\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM3 -b115200 -D -Uflash:w:C:\Download\Arduino\NIBE_ESP8266_test1.ino.with_bootloader.mega.hex:i

(Code compiled on 1.8.2 and uploaded using 1.8.5)

Motivation: I reach my Arduino via a slow XP computer on Teamviewer. Now I do not need to keep both it and my home/developer-computer updated with the same libraries.


hello i need help i am cannot load boot load how to boot load use??

Go Up