I broke the bootloader
-
- Posts: 21
- Joined: Wed Dec 11, 2013 4:03 pm
I broke the bootloader
I seem to have accidentally broken my bootloader. I tried to run a (probably broken/partial) copy of megasokabon, halfway through loading it the screen went black. And now I can't get back to the bootloader. I don't have a cord for the programming interface, but I could theoretically connect the uzebox to my arduino and flash it from there. Theoretically if I were able to connect it, what would I do?
Re: I broke the bootloader
Get the trunk/roms/Bootloader.hex from the Uzebox SVN, connect the Uzebox to Arduino, then flash the Bootloader.hex into the Uzebox with
Some versions of avrdude may support "arduino" instead of "stk500v1".
Code: Select all
$ avrdude -c stk500v1 -p m644 -P usb -U flash:w:Bootloader.hex
-
- Posts: 21
- Joined: Wed Dec 11, 2013 4:03 pm
Re: I broke the bootloader
Thanks!
so... I got this error.
I tried changing usb to the serial port I normally use for my arduin (that would be: /dev/ttyACM0)
which gave me this error:
then I changed stk500v1 to arduino(still using my arduino serial port) and got this:
So... any ideas what I'm doing wrong. It could be that I wired the pins wrong. I soldered some wires to the bottom of the isp socket. If the ground is the pin closest to the audio jack then I probably did it right.
Edit: I just discovered I did have the pins wrong because the green light wasn't on. So I re-wired it. Unfortunately I still get my errors.
Edit: It's also worth noting my pins are connected as so:
Arduino pin 10 to reset
Pin 11 to MISO
Pin 12 to MOSI
Pin 13 to SCK
5v to 5v
gnd to gnd
so... I got this error.
Code: Select all
avrdude: ser_open(): can't open device "usb": No such file or directory
avrdude done. Thank you.
which gave me this error:
Code: Select all
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
Code: Select all
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: Expected signature for ATMEGA644 is 1E 96 09
Double check chip, or use -F to override this check.
avrdude done. Thank you.
Edit: I just discovered I did have the pins wrong because the green light wasn't on. So I re-wired it. Unfortunately I still get my errors.
Edit: It's also worth noting my pins are connected as so:
Arduino pin 10 to reset
Pin 11 to MISO
Pin 12 to MOSI
Pin 13 to SCK
5v to 5v
gnd to gnd
Re: I broke the bootloader
Hmm don't know anything about avrdude but if it can read the chip signature and it is that close seems the wiring is fine. A bit too lazy to dig out my mkii ISP to see if that signature is actually right; and since it is basically "bricked" until you can program it I would just try the -F to override that check and see if she works? All else fails trade the chip via mail with an Uzer who has a working ISP in your country I'd think.
Edit-Ok I pulled out my mkii(needed to get it working on my windows h8te machine anyhow) and my chip is returning 0x1E 0x96 0x09 for an Atmegga 644 20pu 1224. Did you get the chip with an official Uzebox kit or is this a homebrew setup? If it were my chip I would flash it.
Edit-Ok I pulled out my mkii(needed to get it working on my windows h8te machine anyhow) and my chip is returning 0x1E 0x96 0x09 for an Atmegga 644 20pu 1224. Did you get the chip with an official Uzebox kit or is this a homebrew setup? If it were my chip I would flash it.
Re: I broke the bootloader
1e 95 0f is ATmega328. Are you sure you aren't trying to flash the arduino itself? Your cabling is likely to be wrong.
See e.g. this tutorial https://www.sparkfun.com/tutorials/200 on how to set up the arduino as a flash tool for programming other AVR controllers.
See e.g. this tutorial https://www.sparkfun.com/tutorials/200 on how to set up the arduino as a flash tool for programming other AVR controllers.
Re: I broke the bootloader
Can you PM me the hex file that broke your bootloader, i'll check it out. This is suprising since the bootloader has protections to prevent overwriting.
-
- Posts: 21
- Joined: Wed Dec 11, 2013 4:03 pm
Re: I broke the bootloader
Yeah that was my guess. I'll retry using those instructions.Janka wrote:1e 95 0f is ATmega328. Are you sure you aren't trying to flash the arduino itself? Your cabling is likely to be wrong.
See e.g. this tutorial https://www.sparkfun.com/tutorials/200 on how to set up the arduino as a flash tool for programming other AVR controllers.
Sure! give me a sec though, my 'puter doesn't play well with sd cards, so I'll have to borrow someone elses.uze6666 wrote:Can you PM me the hex file that broke your bootloader, i'll check it out. This is suprising since the bootloader has protections to prevent overwriting.
Edit: Just gave it a shot, and unfortunately it's still not working. I did get it connected right (at least I think I did, the power came on on the uzebox) I think I'll try soldering my wires to the ext connections instead of the isp socket.
Edit Edit: Still not working. I plugged in the reset pin to pin 8(that would be the error pin, that lights up when there is an error. I presumed if there was an error the uzebox light would go off because the pin was being powered, which proceeded to happen. (I know it's not the recommended thing to do but I was lazy)) Curious question, is there any circuitry involved or am I just supposed to plug the miso, mosi, sck,... right into the arduino?
-
- Posts: 21
- Joined: Wed Dec 11, 2013 4:03 pm
Re: I broke the bootloader
Well I still can't seem to get it to work. I think I might try on a different 'puter when I have a chance. I was thinking though... maybe it's not the bootloader at all. Maybe it's something else entirely maybe it just shorted somewhere...
Edit: I wasn't able to get it to work on a different computer
And here is the file that supposedly caused my trouble. If someone is willing to take the risk of testing it please tell me what happens:http://www.mediafire.com/download/f1zas ... okoban.uze
Edit: I wasn't able to get it to work on a different computer
And here is the file that supposedly caused my trouble. If someone is willing to take the risk of testing it please tell me what happens:http://www.mediafire.com/download/f1zas ... okoban.uze
Re: I broke the bootloader
Hi!
I had a similar situation last year. When you download a file from the SD card turned out a failure, when you restart a black screen! Connecting through ISP connector programmer gave nothing! When installing the Atmega 644 programmer through the parallel port of the computer chip undecided! The conclusion was one - block FUSE write bits Atmega 644 . Unlikely, but ... We had to make a separate device for Atmega8 which restores the factory FUSE bits per chip sick! And then re-programmed in the programmer!
Here's a story ... now it works!
I had a similar situation last year. When you download a file from the SD card turned out a failure, when you restart a black screen! Connecting through ISP connector programmer gave nothing! When installing the Atmega 644 programmer through the parallel port of the computer chip undecided! The conclusion was one - block FUSE write bits Atmega 644 . Unlikely, but ... We had to make a separate device for Atmega8 which restores the factory FUSE bits per chip sick! And then re-programmed in the programmer!
Here's a story ... now it works!
-
- Posts: 21
- Joined: Wed Dec 11, 2013 4:03 pm
Re: I broke the bootloader
Great! Um... so what exactly do I have to do to fix it? Something like this I'd imagine? http://www.evilmadscientist.com/2007/fi ... on-an-avr/
Edit: I gave the above a try but it keeps cutting interactive mode because:
I definitely think kerby found the problem though, I'm going to see if I can find an argument that could override the "responding" dependence
Edit: I gave the above a try but it keeps cutting interactive mode because:
Code: Select all
avrdude: stk500_recv(): programmer is not responding