Go Down

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


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?


There are some GUI front ends for avrdude that should do what you want.


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:

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 Beginning dump of ATtiny Flash, Fuses, & EEPROM
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 Dump of ATtiny85 completed.



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

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

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131