Go Down

Topic: [Solved] Wipe out sketch from arduino the hard way - 8U2 firmware bug (Read 7930 times) previous topic - next topic

Space_Tinkerer

Feb 23, 2011, 06:23 pm Last Edit: Mar 01, 2011, 12:42 pm by Space_Tinkerer Reason: 1
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!

johnwasser

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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Space_Tinkerer

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

James C4S

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.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

pluggy

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://pluggy.is-a-geek.com/index.html

Space_Tinkerer

#5
Feb 23, 2011, 11:15 pm Last Edit: Feb 24, 2011, 12:13 am by Space_Tinkerer Reason: 1
Thanks Pluggy, I'll try updating the firmware, and post back the results

Space_Tinkerer

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!

pluggy

We'll need Massimo or another admin to do that.  Us mere mortals can't alter the main website.......
http://pluggy.is-a-geek.com/index.html

atmelino

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!

justjed

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 instead of the latest from github?
... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier

gen2thomas

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

jew29

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??


Go Up