Bootloader bug! Read me!

Moderator: adafruit

Please be positive and constructive with your questions and comments.
Locked
adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Bootloader bug! Read me!

Post by adafruit »

I made an annoying mistake on early (v1.0) Fuzebox kits and chips: I didn't set the lockfuses right and so there's nothing keeping you, the gamer, from overwriting it!
Yeek!

There's a couple things you can do to fix it

1) if you have a AVR programmer, use avrdude to run this command "avrdude -c usbtiny -p m644 -u -U lock:w:0x2F:m" and replace usbtiny with whatever programmer you've got. Then double check by running "avrdude -c usbtiny -p m644 -u -U lock:v:0x2F:m" which will verify it

2) If you dont have an AVR programmer, edit avrdude.conf (for windows it sits somewhere around C:\WinAVR\bin but you may have to 'find file' if you're not sure)
Scroll down/search until you find the part that says

Code: Select all

#------------------------------------------------------------
# ATmega644
#------------------------------------------------------------

# similar to ATmega164
then scroll down a little more until you find the part that says

Code: Select all

    memory "flash"
        paged           = yes;
        size            = 65536;
        page_size       = 256;
        num_pages       = 256;
        min_write_delay = 4500;
and replace that with

Code: Select all

    memory "flash"
        paged           = yes;
        size            = 63488;
        page_size       = 256;
        num_pages       = 248;
        min_write_delay = 4500;
note that size has been changed to 63488, which takes out the 2K the bootloader uses, and num_pages is now 248. Then save the file. This will prevent you from overwriting the bootloader by restricting the programming software.

If you already 'bricked' your chip by overwriting the bootloader, and have no way of fixing it (because you dont own any sort of AVR programmer) please email [email protected] so we can get you a replacement!

thanks!

smadin
 
Posts: 7
Joined: Sun Dec 28, 2008 3:29 pm

Re: Bootloader bug! Read me!

Post by smadin »

I apologize if this is a foolish question, but...if the chip's already been bricked by trying to load a too-big file over the FTDI cable, can it be fixed by reflashing the bootloader via e.g. a USBtinyISP (and then correctly setting the fuses)? I had the impression from discussion in the other threads on this issue that it could, but after reading this I'm not sure anymore.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Bootloader bug! Read me!

Post by adafruit »

Yes, sorry that wasnt clear
if you 'bricked the chip' its not actually damaged...you can easily reprogram it with an AVR programmer such as a STK board, AVRISP or usbtinyisp. but some people might not have one

smadin
 
Posts: 7
Joined: Sun Dec 28, 2008 3:29 pm

Re: Bootloader bug! Read me!

Post by smadin »

That's what I was hoping, thanks! Looking forward to getting back up and running once my USBtiny kit arrives :)

User avatar
nkhorman
 
Posts: 4
Joined: Sun Jan 11, 2009 9:17 pm

Re: Bootloader bug! Read me!

Post by nkhorman »

ok, so I borked the bootloader by flashing a hex file via serial that was too large.
I would like to restore it (which I know has to be done via ISP), but I can't locate the bootloader that was used for the fuzebox kit.
can someone point me in the right directon ?

tia

koolkat
 
Posts: 358
Joined: Tue May 06, 2008 8:42 pm

Re: Bootloader bug! Read me!

Post by koolkat »

nkhorman wrote:ok, so I borked the bootloader by flashing a hex file via serial that was too large.
I would like to restore it (which I know has to be done via ISP), but I can't locate the bootloader that was used for the fuzebox kit.
can someone point me in the right directon ?

tia
http://ladyada.net/make/fuzebox/download.html

User avatar
nkhorman
 
Posts: 4
Joined: Sun Jan 11, 2009 9:17 pm

Re: Bootloader bug! Read me!

Post by nkhorman »

koolkat wrote:
nkhorman wrote:ok, so I borked the bootloader by flashing a hex file via serial that was too large.
I would like to restore it (which I know has to be done via ISP), but I can't locate the bootloader that was used for the fuzebox kit.
can someone point me in the right directon ?

tia
http://ladyada.net/make/fuzebox/download.html
um... ya... been there, got that.... correct me if I'm wrong, but there is no bootloader in that package.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Bootloader bug! Read me!

Post by adafruit »

you're not wrong, i forgot about it! the bootloader code is up there now, enjoy!

User avatar
nkhorman
 
Posts: 4
Joined: Sun Jan 11, 2009 9:17 pm

Re: Bootloader bug! Read me!

Post by nkhorman »

ladyada wrote:you're not wrong, i forgot about it! the bootloader code is up there now, enjoy!
Thank you!

In case anyone cares and you have one of these wigglers laying around like I did, that you wanna use for ISP programming instead of buying something, the avrdude.conf config section follows;

Code: Select all

# Parallel port programmers.
programmer
  id    = "lwig";
  desc  = "LART Wiggler";
  type  = par;
  reset = 4;
  sck   = 2;
  mosi  = 3;
  miso  = 11;
;
and a recreation of the wiggler schematic w/ a cable for the 6 pin ISP header.

This worked 1st try with no problems.

Cheers.
Attachments
LART Wiggler to AVR 6 pin ISP
LART Wiggler to AVR 6 pin ISP
wiggler.png (24.38 KiB) Viewed 9427 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Fuzebox (discontinued)”