Pages: [1]   Go Down
Author Topic: Bootloader / serial port communication.  (Read 288 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 20
Posts: 2112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6373
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 33
Posts: 1434
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
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:
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

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23748
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://www.gammon.com.au/forum/?id=11638
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: