Load compiled binary to arduino with xloader


Do you need to load a binary (.hex) to your Arduino? If yes, please read on. There are lot of times you may find yourself in need to load a sketch to Arduino but using Arduino IDE is either too slow or not practical, say you don’t have the libraries for the sketch properly installed. The average compile time I experienced with long project is in the order of a minute. If all you need is to load a program to Arduino, with no need to change the program, you can load a compiled binary and use xloader to Arduino. The upload speed is much faster since there is no compiling anymore. As a designer, you can also distribute firmware of your hardware to a client, all without giving away your source code. Even if you wish to give away your source code, you probably need several custom libraries and the clients may not be able to quickly install and configure the libraries to compile your code in the first place. Anyway, if you are in need to load compiled binary, you should consider xloader. Personally, I load my phi-panel firmware with this program. It’s a time saver.

The following is the home site of the xloader:


It is a very neat tool to load compiled binary. The interface is simple:

For those of you that received a binary file and want to know how to load it, skip the how to create a binary file section.

How to create a binary (.hex) file

To create a binary file, first start Arduino and compile the sketch.

Then go into your windows temp file folder, such as: C:\Users\Liu\AppData\Local\Temp

Inside this folder, you should find a build folder such as: build6341600473098683432.tmp

Inside this folder, look for your main sketch file name with a .hex extension. Say your main sketch is project1.ino, then look for project1.hex. If you noticed your project’s compiled size, this .hex file is twice as large.

Copy the project1.hex file and save it elsewhere, since all build folder content is deleted if you close Arduino.

How to load a binary(.hex) file

First, choose the hex file in the first line, then choose your arduino, the baud rate changes automatically with your device selection. Then choose com port, using the same technique, i.e. select the last port (windows machine). Then press upload and wait for the message on the bottom of the screen to say XXXX KB uploaded.


6 Responses to Load compiled binary to arduino with xloader

  1. Another way to more easily find your compiled .hex files is to configure the IDE to use a user-specified build folder. I first learned this trick from this webpage: http://arduinocommander.blogspot.com/2013/03/upload-sketch.html
    So, in my preferences.txt the third line reads:
    build.path=C:\Users\cdelliott\My Development\Arduino\Build_Box
    The IDE seems to do a good job keeping my Build_Box folder cleaned up even though it is outside my user temp folder path. Just remember to make this change without the IDE running. From what I can tell, it seems that this file is overwritten with the current IDE settings when the IDE is closed.

    Hopefully this (undocumented) feature doesn’t vanish in the future. BTW, I’ve confirmed this working on the following Windows versions: 1.0.3, 1.0.4ERW (uses a different file for preferences.txt, but the technique is identical), 1.0.5, and 1.5.2.

  2. tom c says:

    I get message “can’t open port”. ?????

    • liudr says:

      Sorry for the late response. If you can’t open port, you either are using the wrong port or the port is opened already, say by arduino’s serial monitor.

  3. Jomilson Tolueno says:

    Thank you. This post is just what I needed. I’m compiling Marlin firmware, its too huge for the poor Raspberry to compile. I want to use RaspPi to send the file compiled in PC to 3D printer’s arduino – the printer is away from PC and I dont want to move any of them.

Leave a Reply