Go Down

Topic: Bootloader / serial port communication. (Read 501 times) previous topic - next topic

cjdelphi

Has anyone come across any good links, tutorials... on uploading .hex files?

I'm thinking of having libraries of programs I've written in one area and then selecting a program (*.hex) I've made it uploads to it, so I guess the protocol..

If not, is copying avrdude an option?

westfw

There are some GUI front ends for avrdude that should do what you want.
http://forum.arduino.cc/index.php/topic,8450.0.html
http://sourceforge.net/projects/avrdude-gui/

mrburnette

You can even read images from Arduinos and rewrite that into another (identical) chip:

My article: http://www.instructables.com/id/Copy-n-Paste-Arduino-Firmware/#

If you have a folder full of these HEX files, you can modify the write to disk part of the Batch File to do the dirty for you.  With a little VBA or something free like http://justbasic.com/  you can frontend the process.

Some other of my possibly useful scripts:
http://forum.arduino.cc/index.php?topic=196101.0
http://forum.arduino.cc/index.php?topic=182849.0

A critical item is that from Windows, you want to open the Command Prompt with the correct path to the AVR tools, such as AVRDUDE, which is not generally included in a standard Arduino installation.  I use:

Code: [Select]

PATH=%path%;C:\Program Files\Arduino_105\hardware\tools\avr\utils\bin;


Then, to invoke AVRDUDE to use my ArduinoISP to program an attiny85 would look something like this:
Code: [Select]

avrdude -c arduino -P com9 -p attiny85 -b 19200 -U flash:w:flash_me_lv.hex:i -U lfuse:w:0xF1:m -U hfuse:w:0xD5:m -U efuse:w:0xFE:m

As the USB on the UNO is out on port #9.  The file I am writing is named flash:w:flash_me_lv.hex and it is in Intel format.

I recently purchased an Adafruit Trinket which is attiny85 based.  I wanted a copy of everything in HEX, and this is how I got it:
Code: [Select]

ECHO OFF
CLS
ECHO Beginning dump of ATtiny Flash, Fuses, & EEPROM
ECHO.
ECHO.
ECHO ------------------------------------------------------------------ START FLASH
avrdude -c USBtiny -p ATtiny85 -U flash:r:%temp%\backup_flash.hex:i
ECHO ------------------------------------------------------------------ START Hfuse
avrdude -c USBtiny -p ATtiny85 -U hfuse:r:%temp%\backup_hfuse.hex:i
ECHO ------------------------------------------------------------------ START Lfuse
avrdude -c USBtiny -p ATtiny85 -U lfuse:r:%temp%\backup_lfuse.hex:i
ECHO ------------------------------------------------------------------ START Efuse
avrdude -c USBtiny -p ATtiny85 -U efuse:r:%temp%\backup_efuse.hex:i
REM ECHO ------------------------------------------------------------------ START eeprom
REM avrdude -c USBtiny -p ATtiny85 -U eeprom:r:%temp%\backup_eeprom.hex:i
ECHO.
ECHO Dump of ATtiny85 completed.


Ray


CrossRoads

Check out Nick Gammon's page on loading .hex files from SD cards as well.

http://www.gammon.com.au/forum/?id=11638
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up