Arduino Forum

Using Arduino => Installation & Troubleshooting => Topic started by: Space_Tinkerer on Feb 23, 2011, 06:23 pm

Title: [Solved] Wipe out sketch from arduino the hard way - 8U2 firmware bug
Post by: Space_Tinkerer on Feb 23, 2011, 06:23 pm
Hello everyone!

I bumped to a problem as i was playing with my arduino. I was working with serial communications on arduino. So I wrote a sketch, put a

Serial.println();

command in loop() (I missed my inner if loop, and it runs infinitely) so now i try to upload a new program but i can't because the program keeps printing println on the serial port. Is there a way I can wipe out the program? Preferably a hardware way cause software doesn't seem to work...

P.S. I tried anything obvious (reset, unplug and replug) etc

Thanks!
Title: Re: Wipe out sketch from arduino the hard way
Post by: johnwasser on Feb 23, 2011, 07:16 pm
On modern Arduinos the upload process should reset the processor for you and cause the bootloader to run.  On older models you had to push the reset button just before the upload happened.  You should be able to upload a new sketch if you press the Reset button at just the right time.

If you have a second Arduino you can use it as an In-system Serial Programmer to upload a sketch.  That doesn't go through the USB port on the target Arduino so it will override any existing programming.
Title: Re: Wipe out sketch from arduino the hard way
Post by: Space_Tinkerer on Feb 23, 2011, 07:25 pm
Thanks for the answer John. Actually I fixed it hitting the upload button about 20 times... :P As you mentioned uploading should reset the processor (I have a new Arduino Uno, which I bought about 2 weeks ago) but it didn't work.. I don't know what exactly happened, but persistance pays after all :P Thanks anyway
Title: Re: Wipe out sketch from arduino the hard way
Post by: cmiyc on Feb 23, 2011, 08:53 pm
Try holding the processor in RESET until right before the IDE starts the upload.

To hold in Reset, press and hold the reset button before applying power.  Do not release until about ~1 second after the "Sketch:  XXX of XXXX bytes" message.
Title: Re: Wipe out sketch from arduino the hard way
Post by: pluggy on Feb 23, 2011, 09:49 pm
Sounds like the 8U2 firmware bug on the Uno/Mega2560.  Upgrading the firmware will probably cure it if it is. 

http://arduino.cc/en/Hacking/DFUProgramming8U2

This is the easy way of putting it in DFU mode :

(http://img87.imageshack.us/img87/4207/arduinodfu.jpg)
Title: Re: Wipe out sketch from arduino the hard way
Post by: Space_Tinkerer on Feb 23, 2011, 11:15 pm
Thanks Pluggy, I'll try updating the firmware, and post back the results
Title: Re: Wipe out sketch from arduino the hard way
Post by: Space_Tinkerer on Mar 01, 2011, 12:39 pm
UPDATE -- I just updated the firmware, and now it works great! Pluggy your guide was great help.
Maybe you should add the image to the official guide, because the description there is not very clear.

Anyway, I intentionally loaded the faulty program again, which prints to the serial port, and when I uploaded something else it worked right away. So bug fixed!
Title: Re: [Solved] Wipe out sketch from arduino the hard way - 8U2 firmware bug
Post by: pluggy on Mar 01, 2011, 04:56 pm
We'll need Massimo or another admin to do that.  Us mere mortals can't alter the main website.......
Title: Re: [Solved] Wipe out sketch from arduino the hard way - 8U2 firmware bug
Post by: atmelino on May 20, 2011, 07:00 am
I was having problems with my UNO and Ubuntu when using the serial communication. Pluggy's post and flashing the firmware solved my problem :) Thank you!
Title: Re: [Solved] Wipe out sketch from arduino the hard way - 8U2 firmware bug
Post by: justjed on May 22, 2011, 05:41 am
Well, looks like I have to resort to this. Which is just as well, since my bootloader doesn't do the delay after reset to see if anything's coming in (and I seriously need this, as a n00b programmer).

So, any reason to use Ada's bootloader (http://www.ladyada.net/library/arduino/bootloader.html) instead of the latest from github?
Title: Re: [Solved] Wipe out sketch from arduino the hard way - 8U2 firmware bug
Post by: Gentoo-Thomas on Jun 21, 2011, 10:00 pm
Hello pluggy, many thank's for your good picture. I'm using an mega2560 and have some trouble to upload some sketches to it. Now I wan't to test the 8U2 bugfix. But "the solder jumper on the back of the board (near the map of Italy)" are not present. In my opinion the solder jumpers below the 6 pin ICSP block are the right one on MEGA2560 boards (http://arduino.cc/en/uploads/Main/ArduinoMega2650Back.jpg). Can anybody confirm this?
Thanks in advance, Thomas
Title: Re: [Solved] Wipe out sketch from arduino the hard way - 8U2 firmware bug
Post by: jew29 on Apr 28, 2013, 12:05 am
I am working with the UNO and am trying to reinstall my 8U2 firmware.  I have followed all the above directions, and this is the error I am getting not...any ideas??

(http://)