How to burn bootloader *and* sketch in one go? [SOLVED]

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

How to burn bootloader *and* sketch in one go? [SOLVED]

Postby vputz » Sun Jan 27, 2013 9:31 am

I've asked on the Arduino fora as well, but I figured here would be good, and I'm sure it's been asked before but I sure haven't seen the answer (not sure what exactly to search for).

I'm making a little device which is an interface between old serial gaming devices and a USB port using V-USB (a "hardware driver" if you will). I want it to come flashed with a "basic joystick" sketch so people can get some plug-and-play joy, but I also want it flashed with the Arduino bootloader so that users can tinker and upload their own sketches for mouse/keyboard emulation etc.

I can see how to use both the Arduino environment and avrdude to burn the bootloader, and I can see how to burn a sketch. What I can't see is how to burn both the bootloader and a sketch in one go.

I've got a ZIF-socket minimalist board and a heap of chips, and while I'm waiting for the PCBs to come back for my beta testers, I've got, well, time to burn. Halp?
vputz
 
Posts: 54
Joined: Mon May 03, 2010 4:43 am

Re: How to burn bootloader *and* sketch in one go? [SOLVED]

Postby vputz » Sun Feb 03, 2013 10:16 am

Solved, by the option of reading the full chip and writing it (backup/restore) rather than properly "uploading the software".

Code: Select all
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U flash:r:backup_flash.bin:r
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U eeprom:r:backup_eeprom.bin:r
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U hfuse:r:backup_hfuse.bin:r
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U lfuse:r:backup_lfuse.bin:r
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U efuse:r:backup_efuse.bin:r


and then swapping chips and doing

Code: Select all
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U flash:w:backup_flash.bin
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U eeprom:w:backup_eeprom.bin
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U hfuse:w:backup_hfuse.bin
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U lfuse:w:backup_lfuse.bin
avrdude -C ..\etc\avrdude.conf -p m328p -c usbtiny -U efuse:w:backup_efuse.bin


It didn't seem to work with just "flash", so I added everything else. Perhaps overkill, but it works.
vputz
 
Posts: 54
Joined: Mon May 03, 2010 4:43 am


Return to USBtinyISP

Who is online

Users browsing this forum: No registered users and 2 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [102]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]