bricked a uno, looking for explanations

Discussion about the arduino based g-code interpreter, grbl
dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

bricked a uno, looking for explanations

Post by dointhangs » Thu Aug 30, 2012 11:23 am

OK I have a problem here and I haven’t quite put my finger on whats going on. What would happen to a grbl arduino uno (R3) if I had accidently tried to send an arduino sketch to it using arduino ide? I am actually not certain but I think I might have done that… probably had gcode sender and arduino programs open simultaneously late one night. I didn’t really notice this huge problem until the next day so not sure.
Board in question DOES show up as a com port on a pc. Unresponsive to any and all $ commands from any of the gcode senders on pc or mac. XLoader will not play with it either at all. Arduino IDE wont upload to it.
I have another uno on hand, was able to use XLoader to get grbl on it, plugged my stepper shield into it and am back in business so that’s good.
What is my plan now on this essentially bricked Uno? I don’t really want to break the 2nd Uno so I haven’t been pushing it through any steps to try to recreate the origin of the problems I am guessing at above.
Hey as a follow up question will the Leonardo be able to load and run grbl? It’s a cheaper board and all.
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

potatotron
Posts: 135
Joined: Sun Apr 29, 2012 12:47 am
Location: Southern California
Contact:

Re: bricked a uno, looking for explanations

Post by potatotron » Thu Aug 30, 2012 3:45 pm

A lot of things could have happened to make the 1st Uno stop responding to normal commands, GRBL or IDE. My guess is the bootloader got corrupted, but that's just speculation.

Lucky for you, you have a 2nd Uno so you can probably reflash the bootloader on the 1st, then you should be able to either reload GRBL with XLoader and/or load programs from the IDE.

Connect your bad Uno to your good one like this:

http://arduino.cc/en/Tutorial/ArduinoISP

Now download this and upload to your good Uno:

https://github.com/WestfW/OptiLoader

This program will burn OptiBoot (the default Uno bootloader) to the bad board via SPI. Open the serial monitor and you can see it happen, but note that it happens pretty quickly so don't blink or you'll miss it.

As far as getting a Leonardo to run GRBL -- there's nothing special about the code so I'm sure it could be adapted, but the pins and ports are different between the chips (ATMega328 on the Uno, ATMega32U4 on the Leonardo) and the way the serial port is handled (it's a virtual USB interface for the 32U4, it's a physical UART on the Mega328) so you would have some work to do.

Good luck!

dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Re: bricked a uno, looking for explanations

Post by dointhangs » Fri Aug 31, 2012 3:34 am

P-tron unfortunately no great news. I was hopeful for a sec that things were coming together - as I ran the sketch both boards blinked in the same patterns and I got the somewhat encouraging serial display below during that process. But detaching the board and trying to upload blink resulted in the same warning:
avrdude: stk500_recv(): programmer is not responding

So with this wiring setup if I upload blink when they are attached both boards behave identically. But if I detach the bad board and power separately it doesnt keep the sketch, its just a slave to that good board?


OptiLoader Bootstrap programmer.
2011 by Bill Westfield (WestfW)

Target power on! ...
Starting Program Mode [OK]

Reading signature:950F
Searching for image...
Found "optiboot_atmega328.hex" for atmega328P
Start address at 7E00
Total bytes read: 502

Setting fuses for programming
Lock: 3F FFE000 Low: FF FFA000 High: DE FFA800 Ext: 5 FFA400

Programming bootloader: 512 bytes at 0x3F00
Commit Page: 3F00:3F00
Commit Page: 3F40:3F40
Commit Page: 3F80:3F80
Commit Page: 3FC0:3FC0

Restoring normal fuses
Lock: 2F FFE000

Target power OFF!

Type 'G' or hit RESET for next chip
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

potatotron
Posts: 135
Joined: Sun Apr 29, 2012 12:47 am
Location: Southern California
Contact:

Re: bricked a uno, looking for explanations

Post by potatotron » Fri Aug 31, 2012 4:51 am

Your from OptiLoader is perfect, so it definitely restored the bootloader to the corrupt board. It should have worked.... once it's done, it's a brand new standalone Uno, no slaving or anything like that.

Let's make sure the serial side of the Uno is working by doing a loopback test. Here's the formal way (from https://wiki.archlinux.org/index.php/Arduino)

"You can perform a general function test of the Uno by putting it in loopback mode and typing characters into the arduino serial monitor at 115200 baud. It should echo the characters back to you. To put it in loopback, short pins 0 -> 1 on the digital side and either hold the reset button or short the GND -> RESET pins while you type.:

I personally think it's easier to just pull the ATMega chip out of the Uno, then jumper pins digital 0 and 1, then try the serial monitor in the IDE.

If the loopback test passes, the only other thing I can think to test is to confirm you've got the right serial port selected in the IDE, and the right board type (Uno).

Good luck!

dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Re: bricked a uno, looking for explanations

Post by dointhangs » Sat Sep 01, 2012 5:18 am

no dice on echo for the method in the link or in your preferred method. I did it on the good board and saw the echo, so I know my wiring was right. Does this mean any thing good in terms of diagnostics?
this is pretty rare kind of stuff right? It turns out I kind of need all of my arduinos to be functional... I think I might drop sparkfun a line on monday sharing with them that I dont think I subjected this thing to anything too extreme. It was working fine, nothing changed, then it wasnt working. it is in an acrylic case, its not like anything conductive on the back of the board. I started off the thread worried about uploading conflicting sketches but it really shouldnt blow up the board if I sent a grbl board an arduino sketch even if it was midway through a cnc job? (which it wasnt).
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

potatotron
Posts: 135
Joined: Sun Apr 29, 2012 12:47 am
Location: Southern California
Contact:

Re: bricked a uno, looking for explanations

Post by potatotron » Sat Sep 01, 2012 4:01 pm

My guess is it means the main chip (ATMega328) on the bad board is fine. You could try swapping the chips between the two boards and see if you can upload, I bet you can.

Since you can't do a loopback test on the bad board, it's probably the USB <-> serial chip that's causing the problems. On the Uno this is actually yet another Atmel chip -- an ATMega8U2 or ATMega16U2, depending on what revision your board is (the difference is how much flash the chip has, otherwise they're identical). You can actually reflash those chips as well, but you'll need a ICSP AVR programmer (like this http://www.sparkfun.com/products/9825) to do it. You're probably right that it will be easier to make SparkFun deal with it.

As to why this happened...you're right it's rare. I've only every blown a board like this out once and that was an obvious mistake on my part. Simply uploading sketches shouldn't be able to cause this at all.

dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Re: bricked a uno, looking for explanations

Post by dointhangs » Sun Sep 02, 2012 6:46 am

Your guess is absolutely right - yes can upload to the main chip on the bad board (put it in the good arduino)... Unnecessary but just to confirm I also put the main chip from the good board into the bad board and same problems. thanks for the link to the programmer. I am not going to order one of those or anything just yet but good to know. So - I think it is a valid thing to take out main chip and put into a good board, reprogram, and then put back in this board?? The blink sketch I loaded onto it is behaving nicely. Props on walking me through this, hey I hope your big LED boards are coming along. When are you selling those man, I totally want what you did with your weenduino youtube video in my living room! awesome music taste too:-) Hey last thing do you know where this usb to serial chip is on the uno, I did a search for it but no luck. All interesting stuff, thanks again.
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

potatotron
Posts: 135
Joined: Sun Apr 29, 2012 12:47 am
Location: Southern California
Contact:

Re: bricked a uno, looking for explanations

Post by potatotron » Wed Sep 05, 2012 10:04 pm

So - I think it is a valid thing to take out main chip and put into a good board, reprogram, and then put back in this board??
I don't think that will work...It looks like the problem with the bad board is the serial interface. You'll need that link so gcode sender can talk to GRBL. You should definitely try it out, however, because I could be wrong. Maybe the bad board won't work at the high speed serial programming uses (115,200 baud I think) but will work OK for the slower serial link of GRBL (9600 baud).
I hope your big LED boards are coming along. When are you selling those man, I totally want what you did with your weenduino youtube video in my living room!
Thanks! Everything has unfortunately been on hold for months now....I've been working a lot of overtime with my regular job and all my fun stuff has been on hold for a couple of months now...but I'm still hopeful I can have products ready for sale before Christmas...
do you know where this usb to serial chip is on the uno
Attached is a pic. It's got an Atmel logo and right under that should say something like Mega16U2 or Mega8U2 on it.
Attachments
Screen shot 2012-09-05 at 3.02.16 PM.png
Screen shot 2012-09-05 at 3.02.16 PM.png (275.7 KiB) Viewed 3268 times

dointhangs
Posts: 179
Joined: Tue Jun 05, 2012 7:31 pm

Re: bricked a uno, looking for explanations

Post by dointhangs » Wed Sep 05, 2012 11:04 pm

Hey get your priorities straight p-tron, we need cool LED's and pick and place breakthroughs none of this 9-5 stuff. Thats crazy talk, pull it together haha.
I dont think this arduino will ever be a candidate to run grbl again. I will hopefully get it replaced. What I meant in my last post was if they wont replace it I think I can program the main chip in another board and then plug back in to this one and it will run a program (I wont be able to load programs using this arduino).
Shapeoko #298, dual drive upgrade, acme z axis, open bed endplates and a slightly larger ("expanded desktop") work area!

potatotron
Posts: 135
Joined: Sun Apr 29, 2012 12:47 am
Location: Southern California
Contact:

Re: bricked a uno, looking for explanations

Post by potatotron » Thu Sep 06, 2012 3:52 pm

Haha I do need to straighten out my priorities...working for the man is dragging me down...
I think I can program the main chip in another board and then plug back in to this one and it will run a program (I wont be able to load programs using this arduino).
Yep, you can definitely do that. Just be careful with the pins so they don't get bent; chip legs aren't designed to be repeatedly removed & reinserted and they're pretty easy to break off.

Post Reply