Preamble

So y'all accept been given a .hex file, and y'all need to get it onto the Arduino. How is that possible. Perchance you are used to jst dealing with .ino files, compiling them in the Arduino IDE and and then letting it practice the residual?

This post was inspired past Recalibrating Domicile-position.

Meet as well

  • How do I change my EEPROM settings in Repetier

Links

  • Arduino IDE
  • AVRdude
  • XLoader
  • Arduino Builder
  • Arduino Uploader

Info

A major part of the Arduino IDE is sort of semi-hidden, and that is some guy chosenavrdude. Actually, AVRDUDE – AVR Downloader/UploaDEr is a standalone binary.

As an aside, at that place is also gcc which does the compiling, but that is another matter. The avrdude uploads the compiled binary provided by gcc on to the Arduino, via the USB port (COM port).

You can invoke this from the command line (assuming that you have the Arduino IDE installed).

You will need to specify (see command line pick descriptions):

  • The baud rate of the COM port (-b)
  • The COM port (-P)
  • The processor used in the board (for the Arduino Mega2560 board: ATmega2560) (-p)
  • The path to the .hex file (-U)
  • The path to the .conf file of avrdude itself (-C)
  • Verbose fashion, and so see what is happening (-v)
  • Specify the developer to be used (-c). Run across the -c pick on command line pick descriptions for more information.
  • Disable auto erase for flash (-D)

The control volition be of the class:

                <path to arduino>/hardware/tools/avr/bin/avrdude -C<path to arduino>/hardware/tools/avr/etc/avrdude.conf -v -patmega2560 -carduino -b 115200 -cstk500v2 -P<name of serial port> -D -Uflash:w:<path to hex file>:i              

This case above:

  1. Specifies the total path to the avrdude binary
  2. Specifies the full path to the avrdude.conf configuration file
  3. Verbose way
  4. The ATmega2560 processor used in the Arduino Mega2560 board
  5. The Arduino programmer
  6. The baud rate of the USB port
  7. The Atmel STK500 Version 2.x firmware developer (may non be required)
  8. The port to which the Arduino board is continued
  9. Disables automobile-wink as information technology is not required – Auto erase is not used for ATxmega devices as these devices tin apply page erase before writing each folio and so no explicit chip erase is required. Note however that any page non afflicted past the electric current operation will retain its previous contents.
  10. The memory to be uploaded to and the path to the .hex file (see the -U pick on command line option descriptions for more than information):
    1. flash specifies the flash ROM of the device.
    2. due west: read the specified file and write information technology to the specified device retention
    3. :i specifies Intel Hex

Examples

For Windows

                C:\dev\Arduino\hardware\tools\avr\bin\avrdude  -CC:\dev\Arduino\hardware\tools\avr\etc\avrdude.conf  -v -patmega2560 -carduino -b115200 -cstk500v2 -P\\.\COM1  -D -Uflash:westward:C:\Users\<username>\Documents\firmware.hex:i              

For OSX

                /Applications/Arduino/hardware/tools/avr/bin/avrdude  -C/Applications/Arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega2560 -carduino -b115200 -cstk500v2 -P\\.\COM1 -D -Uflash:due west:/Users/<username>/Documents/Arduino/firmware.hex:i              

Alternatives

If you are not comfortable using a command line interface (CLI) it might be easier to use a GUI solution…

XLoader

For a Windows only solution, run into Uploading Arduino HEX files with XLoader

xloader

From the author's website:

I've fabricated a small programme that can be used to upload your ain *.hex files to arduino boards using the bootloader. That means you don't need a flash programmer. I fabricated it for my ain use and found it pretty useful. So now I've made a more than user friendly version..
To use it compile y'all're code in something like AvrStudio. Then just get-go XLoader.exe, selection a hex file and press upload. That's it.
Proficient news it at present also supports Arduino Uno.

Arduino Architect

From Arduino Builder – standalone utility for building and uploading Arduino sketches

  1. Choose file, either a sketch file (.ino), an HEX file (.hex) or an ELF file (.elf)
  2. Cull the board type in the dropdown list.
  3. Click on the serial port (or USBASP push) and the uploading will exist proceeded.

Arduino Uploader

From the same page, at that place is Arduino Uploader which is a command line version of Arduino Builder.