Please be aware of all shipping deadlines before placing your order - we cannot guarantee orders will arrive before Christmas!

[Mostly Solved] Messed up Bootloader
Moderator: adafruit

[Mostly Solved] Messed up Bootloader

by Nender on Fri Dec 26, 2008 3:40 pm

After assembling me new Fuzebox, I tried out compiling and downloading a few programs. What I didn't know at the time, is that I was missing a few parts. (R23, R24, C4, C23) Anyways, long story short, I somehow messed up the bootloader (Or possibly the hardware) by repeatedly trying to upload a program when it failed. Before, things would go smoothly, until at between 50-75 percent the connection would die and give a "stk500_recv(): programmer is not responding" error. I did for the record get it to complete once. Now when I connect via FTDI I get this:
Code: Select all | TOGGLE FULL SIZE
Last login: Fri Dec 26 10:18:57 on ttys000
Macintosh:~ nathan$ /usr/local/AVRMacPack/bin/avrdude -p m644 -c stk500v1 -P /dev/cu.usbserial-FTE4XWSL -U flash:w:/Users/nathan/Desktop/ESD_Attack.hex

avrdude: stk500_recv(): programmer is not responding
Macintosh:~ nathan$

Its different than when I connect without resetting, but I think there is just nothing to accept the file. If I get an AVR programmer, is there some way to restore the bootloader? Even better, is there some way to restore it using FTDI? And finally, is there some way to confirm that it isn't a hardware issue?

If you can fix this, or answer any of the questions you are my hero.
Last edited by Nender on Tue Feb 10, 2009 1:13 pm, edited 1 time in total.
Nender
 
Posts: 9
Joined: Fri Dec 26, 2008 2:36 pm

Re: [Help] Messed up Bootloader

by adafruit on Sat Dec 27, 2008 4:05 pm

so you really need C23 in order for the bootloader to restart correctly! you can email support@adafruit.com for replacement parts
otherwise, try pressing the reset button just before uploading
User avatar
adafruit
 
Posts: 11779
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: [Help] Messed up Bootloader

by Jhysaun on Mon Dec 29, 2008 2:18 am

Im pretty sure this happened to me too. Avrdude failed a few times and I kept trying and trying until I soon got no response from it. I then plugged the Fuze box into my TV and get no signal from it. If I press the reset button the LED does not blink, which makes me suspect that the bootloader has somehow gotten erased. Is their any way to put it back on with the FDTI cable?
Jhysaun
 
Posts: 1
Joined: Mon Dec 29, 2008 2:14 am

Re: [Help] Messed up Bootloader

by smadin on Mon Dec 29, 2008 12:37 pm

I seem to be having a similar problem. I had no difficulty assembling my Fuzebox — the build instructions here on ladyada.net are excellent, thank you — and I did make sure to put in C23, C4 and R24, although they're actually omitted from the build directions, as it looked like they were installed in the photos of the completed board. The Fuzebox was working, as far as I could tell, perfectly, for about a day. It booted into the colorbar demo just fine, and I was able to load the sprite demo and Uze's new sprite engine demo. I had it powered from the FTDI cable while hooked up to the TV, to minimize the time it took to get new code loaded and running, and I tried loading some of Clay's demos. When I tried maze.hex, race.hex and demo2.hex, avrdude appeared to program the Fuzebox correctly, and the LED blinked as expected, but in all three cases, I got no audio or video output, no "kaching," no Uzebox logo. I loaded spritedemo-v2 again and it worked, so I tried Clay's halloween2008.hex. avrdude failed with this output:
Code: Select all | TOGGLE FULL SIZE
Rawls:~/fuzebox/demos smadin$ avrdude -p m644 -c stk500v1 -P /dev/cu.usbserial-FTE4XVH6 -U flash:w:halloween2008.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e9609
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "halloween2008.hex"
avrdude: input file halloween2008.hex auto detected as Intel Hex
avrdude: writing flash (64608 bytes):

Writing | ################################################## | 99% 14.86savrdude: stk500_recv(): programmer is not responding


And subsequently, every attempt to run avrdude just returns 'avrdude: stk500_recv(): programmer is not responding' twice. The LED no longer blinks when the Fuzebox is powered and I hit the reset switch, and obviously no signal gets to the TV. I've closely (visually) inspected all the solder joints, and they all appear to be clean and strong, no cold joints or shorts. Nothing in the Fuzebox heats up when power is connected, no magic smoke appears to have escaped from anything, and I've confirmed steady, correct voltage coming out of the regulator ICs and going into the '644.

I don't have an ISP cable, but can certainly get/make one; I do have a BBB Arduino and a second FTDI cable which I'll have access to again tomorrow, but since the Fuzebox doesn't even blink when it's just connected to the 9v wall wart, I doubt the cable is the problem.

Sorry for the lengthy comment; I've tried to eliminate any possibilities I knew off the top of my head how to check. Any thoughts on what might be the problem? Have I managed to brick my '644?
Something there is that doesn't love a wall,
That wants it down

--Robert Frost, "Mending Wall"
smadin
 
Posts: 7
Joined: Sun Dec 28, 2008 3:29 pm

Re: [Help] Messed up Bootloader

by uze6666 on Mon Dec 29, 2008 3:24 pm

You guys probably erased the bootloader by trying to flash big hex files (perhaps the bootloader protect fuse was not set?). Although I never used the FTDI cable, I experienced the same in reworking the "cap hack". I flashed something around 64K and ... blank screen, no video signal, nothing! Since I use ISP to program, its no problems at all -- I could still reflash with a a smaller HEX and it would work. For big Hex files, the key here seems to be to disable the "boot reset vector enabled" fuse. If you leave it here, seems it will use any data at a specific hi-memory location in flash and use it as the boot vector. That said, don't disable the fuse if you are using the the FTDI cable+bootloader or it won't boot again!

So in the end, I personally prefer the use of an SPI programmer for the (F)Uzebox. Not only do you get ~2K more for you programs but it's faster to boot and flash, and most importantly, you will never brick your mega644! Ladyada sells some for very low prices and there is also the AVRISPMkII from Atmel which I use (a bit more expensive at ~34$ at Digikey).

Cheers,

Uze
uze6666
 
Posts: 31
Joined: Sat Dec 27, 2008 4:00 pm

Re: [Help] Messed up Bootloader

by tim1724 on Mon Dec 29, 2008 4:43 pm

yep, I did the same thing. (DO NOT try to install the "halloween" demo via FTDI cable.. it's too big :-)
tim1724
 
Posts: 7
Joined: Mon Dec 08, 2008 5:59 pm

Re: [Help] Messed up Bootloader

by smadin on Mon Dec 29, 2008 4:51 pm

Ah ha, that makes sense. Thanks! I should have paid more attention to the file size, obviously — that's embarrassing. ISP cable it is!
Something there is that doesn't love a wall,
That wants it down

--Robert Frost, "Mending Wall"
smadin
 
Posts: 7
Joined: Sun Dec 28, 2008 3:29 pm

Re: [Help] Messed up Bootloader

by Nender on Sat Jan 03, 2009 2:14 pm

Yeah, that's what I was afraid of. Just wanted to completely rule out any chance of hardware malfunction. It's really great that in these close-knit development communities, you can actually get a response from the head devs themselves. I'll probably order the USBtinyISP in the next few days. Thanks for the help, everyone! I have several new heroes.
Nender
 
Posts: 9
Joined: Fri Dec 26, 2008 2:36 pm

Re: [Help] Messed up Bootloader

by adafruit on Sat Jan 03, 2009 5:26 pm

actually, its even WORSE than forgetting about the lock bits
the problem is that if you run the command
avrdude -c stk500v2 -P com1 -p m644 -B 10 -u -U lfuse:w:0xFE:m -U hfuse:w:0xDC:m -U efuse:w:0xFD:m -U lock:w:0xEF:m
avrdude will -say- that the lock bits were set...but they arent!
you have to run it as a separate command for it to 'stick'
ill post a sticky/announce on the topic
User avatar
adafruit
 
Posts: 11779
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: [Help] Messed up Bootloader

by smadin on Sun Jan 25, 2009 12:08 pm

By the way, finally found time to get my USBtinyISP kit built, and sure enough, flashing the bootloader worked perfectly, and my Fuzebox is happy again. Thanks for the help!
Something there is that doesn't love a wall,
That wants it down

--Robert Frost, "Mending Wall"
smadin
 
Posts: 7
Joined: Sun Dec 28, 2008 3:29 pm