Programming Bootloader
Moderator: adafruit

Programming Bootloader

by Synclavier on Mon Oct 19, 2009 9:39 am

I programmed the Uzebox SD Loader and it doesn't work, and as a result I cannot get the original bootloader back. Programming Boulderdash works...

I used the latest AVR Studio with USBTinyISP, and jumpered R4 and R7.

Does anyone have the correct settings to flash back the original and the Uzebox SD Loader :?:
Synclavier
 
Posts: 8
Joined: Mon Oct 19, 2009 9:26 am

Re: Programming Bootloader

by adafruit on Mon Oct 19, 2009 10:33 am

the bootloader should be in the download package from ladyada.net
User avatar
adafruit
 
Posts: 11672
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Programming Bootloader

by Synclavier on Tue Oct 20, 2009 1:07 pm

I have the two bootloaders in hex, but using avrdude I cannot flash them. It gives an error when I program them. I was wondering what special option I need to add to flash the bootloaders (SD and Normal)?

In the meantime I can compiled maze and using avrdude uploading was easy and working. Using avrstudio when I program the bootloaders I get the error 0x013A = 0xFF should be 0x00.
Synclavier
 
Posts: 8
Joined: Mon Oct 19, 2009 9:26 am

Re: Programming Bootloader

by adafruit on Tue Oct 20, 2009 2:12 pm

if you dont need the bootloader, id skip it. it wont be included in future fuzeboxen
User avatar
adafruit
 
Posts: 11672
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Programming Bootloader

by Synclavier on Wed Oct 21, 2009 5:07 pm

The Fuzebox is when build a closed box, to program it I have to open it and put a cable inside. If we can use the boot sd loader, we only have to put the files on the sd card.

How do you program the original fuzebox bootloader?
Synclavier
 
Posts: 8
Joined: Mon Oct 19, 2009 9:26 am

Re: Programming Bootloader

by adafruit on Sat Oct 24, 2009 3:59 pm

we use a usbtinyisp
User avatar
adafruit
 
Posts: 11672
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Programming Bootloader

by uze6666 on Mon Oct 26, 2009 12:35 pm

I programmed the Uzebox SD Loader and it doesn't work, and as a result I cannot get the original bootloader back.

When you say it does not work, what's the symptoms? Have you set the bootloader size fuse (BOOTSZ)? The SD bootloader is bigger than the Fuzebox one, so this must be set correctly.

-Uze
uze6666
 
Posts: 29
Joined: Sat Dec 27, 2008 3:00 pm

Re: Programming Bootloader

by Synclavier on Wed Oct 28, 2009 3:58 pm

See below the settings:

Flash1.jpg
Flash1.jpg (294.04 KiB) Viewed 6194 times
Synclavier
 
Posts: 8
Joined: Mon Oct 19, 2009 9:26 am

Re: Programming Bootloader

by Synclavier on Wed Oct 28, 2009 3:59 pm

See below the flash
Flash2.jpg
Flash2.jpg (360.5 KiB) Viewed 6193 times
Synclavier
 
Posts: 8
Joined: Mon Oct 19, 2009 9:26 am

Re: Programming Bootloader

by Synclavier on Wed Oct 28, 2009 4:08 pm

When I start the Fuzebox there is a fuzzy line after a few seconds when flashed with avrstudio as a above two pcitures.

Flashing the demo file OK:

avrdude -c usbtiny -p atmega644 -U flash:w:Uzeamp.hex


Flashing the fuzebox bootfile:

avrdude -p m644 -c usbtiny -e -U hfuse:w:0x12:m -U lfuse:w:0xef:m -U flash:w:ATmegaBOOT_644.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9609
avrdude: erasing chip
avrdude: reading input file "0x12"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

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

Reading | ################################################## | 100% 0.00s

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

Writing | ################################################## | 100% 0.02s

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

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "ATmegaBOOT_644.hex"
avrdude: writing flash (65512 bytes):

Writing | | 0% 0.00s
avrdude: error: usbtiny_send: usb_control_msg: sending control message failed, w
in error: The I/O operation has been aborted because of either a thread exit or
an application request.
(expected 128, got -116)
Writing | ################################################## | 100% 0.55s

avrdude: failed to write flash memory, rc=-1

avrdude: safemode: Fuses OK

avrdude done. Thank you.
Synclavier
 
Posts: 8
Joined: Mon Oct 19, 2009 9:26 am

Re: Programming Bootloader

by uze6666 on Fri Oct 30, 2009 1:10 pm

I don't know about the Fuze bootloader and I don't use USBTiny, but the settings in the pictures looks good to me, it should work. Which HEX version did you use?

-Uze
uze6666
 
Posts: 29
Joined: Sat Dec 27, 2008 3:00 pm

Re: Programming Bootloader

by adafruit on Fri Oct 30, 2009 4:12 pm

try using -B 1 in avrdude
User avatar
adafruit
 
Posts: 11672
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Programming Bootloader

by Synclavier on Fri Oct 30, 2009 4:16 pm

In the example in AvrStudio I used the first sdbootloader from the uzebox forum. In Avrdude I used the Fuzebox bootloader, the parameters I used from another standard bootloader with same bootloader size. I checked all available versions of the bootloaders in both programs with different parameters.

One of the issues is that with Avrdude programming the flash is always without problems, using Avrstudio sometimes gives errors (small glitches in the programs, or error during verify).
Synclavier
 
Posts: 8
Joined: Mon Oct 19, 2009 9:26 am

Re: Programming Bootloader

by Synclavier on Thu Nov 05, 2009 4:32 pm

Today received the STK500 avr programmer, and flashed the Fuzebox without any problems. The USBtinyISP did not program the fuses correct.

I compiled the last SDBootloader and works without any problems.... :)
Synclavier
 
Posts: 8
Joined: Mon Oct 19, 2009 9:26 am