Burning Bootloader to 168 avrisp mk2 and OSX

Well, it looks like the fuses got written successfully. Does it do anything after that?

If not, you could try running the next command manually:

bin/avrdude -p m168 -b 115200 -P usb -c avrispmkII -D -U flash:w:ATmegaBOOT_168.hex:i

well that is the point ... it just stops there, but you got me thinking and I went ahead and created and ran "burn2.command"


#!/bin/sh
IPATH=echo $0 | sed s/[^\/]*$//;
CMD="$IPATH/bin/avrdude"
OPTS="-p m168 -b 115200 -P usb -c avrispmkII"

Erase chip write lock and fuses

#$CMD $OPTS -e -U lock:w:0x3f:m -U hfuse:w:0xdf:m -U lfuse:w:0xff:m -U efuse:w:0x00:m

Upload bootloader code

$CMD $OPTS -D -U flash:w:ATmegaBOOT_168.hex:i

Lock boot section

$CMD $OPTS -U lock:w:0x0f:m

It ran, and it worked, I have a working bootloader, even loaded a program to it, thanks Dave ... bbbuuuttttttt ....I noticed the time it took to verify 512 seconds ... is that right?????????? Add to that the "communications error", each time avrdude had to be invoked there was about 2-3 minutes of floundering around before it started writing. The whole process took over 20 minutes, why did it abort the script the first time and not the second time?

OK, I just added all the calls onto one line in yet another version of "burn.command" so that avrdude has to "find" the avrisp mkii only once, and it worked. The total time was significantly less. After 6 minutes it started displaying output coming in near the end of the writing flash ... verifying still took 512 seconds ... total time was under 16 minutes

$CMD $OPTS -e -U lock:w:0x3f:m -U hfuse:w:0xdf:m -U lfuse:w:0xff:m -U efuse:w:0x00:m -D -U flash:w:ATmegaBOOT_168.hex:i -U lock:w:0x0f:m

Again ... what am I doing wrong ... p.s. kg4wsv, if AVRISP MKII doesn't show up at /dev/tty where does it show up?

cheers ... BBR (aka n1bq)


Golem:/Applications/arduino-0008/bootloader-usb brian$ ./burn4.command
avrdude: stk500v2_getsync(): error communicating with programmer: (0)

avrdude: AVR device initialized and ready to accept instructions

Reading | ##### | 100% 0.10s

avrdude: Device signature = 0x1e9406
avrdude: erasing chip
avrdude: reading input file "0x3f"
avrdude: writing lock (1 bytes):

Writing | ##### | 100% 0.04s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3f:
avrdude: load data lock data from input file 0x3f:
avrdude: input file 0x3f contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ##### | 100% 0.03s

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xdf"
avrdude: writing hfuse (1 bytes):

Writing | ##### | 100% 0.03s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xdf:
avrdude: load data hfuse data from input file 0xdf:
avrdude: input file 0xdf contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ##### | 100% 0.03s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xff"
avrdude: writing lfuse (1 bytes):

Writing | ##### | 100% 0.10s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xff:
avrdude: load data lfuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ##### | 100% 0.04s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0x00"
avrdude: writing efuse (1 bytes):

Writing | ##### | 100% 0.11s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x00:
avrdude: load data efuse data from input file 0x00:
avrdude: input file 0x00 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ##### | 100% 0.03s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "ATmegaBOOT_168.hex"
avrdude: writing flash (15916 bytes):

Writing | ##### | 100% 51.71s

avrdude: 15916 bytes of flash written
avrdude: verifying flash memory against ATmegaBOOT_168.hex:
avrdude: load data flash data from input file ATmegaBOOT_168.hex:
avrdude: input file ATmegaBOOT_168.hex contains 15916 bytes
avrdude: reading on-chip flash data:

Reading | ##### | 100% 512.78s

avrdude: verifying ...
avrdude: 15916 bytes of flash verified
avrdude: reading input file "0x0f"
avrdude: writing lock (1 bytes):

Writing | ##### | 100% 0.11s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0f:
avrdude: load data lock data from input file 0x0f:
avrdude: input file 0x0f contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ###### | 100% 0.03s

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

Golem:/Applications/arduino-0008/bootloader-usb brian$