Arduino Forum

Using Arduino => Installation & Troubleshooting => Topic started by: 1946thom on Jul 03, 2011, 03:22 am

Title: After running the Hello World in repeat mode
Post by: 1946thom on Jul 03, 2011, 03:22 am
I loading into my Arduino the Hello World sketch and it worked correctly. I then loaded in the repeating sketch and it seems to lock up my Arduino. I can't get it load in anything else, and the TX led is on all the time. I think I may have lost the ability for the computer to upload to the Adduino. Is there some way to reset the Arduino to clear out this sketch. Thom,
Title: Re: After running the Hello World in repeat mode
Post by: johnwasser on Jul 03, 2011, 03:59 am
Unplug the USB cable.
Hold down the Reset button.
Plug in the USB cable.
Click on the Upload button for a sketch.
When you see the "Binary sketch size:" message in the sketch window, release the Arduino reset button.
Title: Re: After running the Hello World in repeat mode
Post by: CrossRoads on Jul 03, 2011, 04:09 am
Tell him Why he needs to do that ...
Title: Re: After running the Hello World in repeat mode
Post by: 1946thom on Jul 03, 2011, 04:20 am
I tried your sugestion.Now I get an error message of avrdude, stk 500(); programmer is not responding. When I release the reset button I get several flashes from the L led the it goes back into the TX led on steady. THom,
Title: Re: After running the Hello World in repeat mode
Post by: johnwasser on Jul 03, 2011, 04:30 am

I tried your sugestion.Now I get an error message of avrdude, stk 500(); programmer is not responding. When I release the reset button I get several flashes from the L led the it goes back into the TX led on steady. THom,


Two possibilities:
    The USB driver is not ready in time when you click on the upload button.
    You are not releasing the Reset button in time.

Try this:

Unplug the USB cable.
Hold down the Arduino Reset button.
Plug in the USB cable.
WAIT TEN SECONDS.
Click on the Upload button for a sketch.
When you see the "Binary sketch size:" message in the sketch window, release the Arduino reset button.
Title: Re: After running the Hello World in repeat mode
Post by: 1946thom on Jul 03, 2011, 04:54 am
It took me running your suggestion several times before I got it running again. Thank you so very much. Can you explain to me what happens when you do the sequence that you suggested. Thank you again. Thom,
Title: Re: After running the Hello World in repeat mode
Post by: smeezekitty on Jul 03, 2011, 08:40 am
This bug hasn't been fixed yet?
Title: Re: After running the Hello World in repeat mode
Post by: johnwasser on Jul 03, 2011, 04:58 pm
By popular demand... the explanation:

My theory is that a sketch with runaway serial output is filling a lot of buffers (possibly all of them) in the USB driver on your host system.  When you try to upload, either the commands do not get sent because there are no buffers available or the commands get sent and the responses are stuck behind a long queue of previous input.

1) Unplug the USB cable.  (This causes the USB driver to clear the buffers.)
2) Hold down the Arduino Reset button. (This prevents the Arduino sketch from running and flooding the buffers.)
3) Plug in the USB cable.  (This re-establishes the USB connection so you can upload.)
4) WAIT TEN SECONDS.  (This gives the USB driver time to settle.)
5) Click on the Upload button for a sketch. (This begins the compile process.)
6) When you see the "Binary sketch size:" message in the sketch window, release the Arduino reset button. (This allows the bootloader to run and look for upload commands.  The message signals the end of the compile process and the start of the upload process.)
Title: Re: After running the Hello World in repeat mode
Post by: cmiyc on Jul 04, 2011, 02:56 am
Quote
My theory is that a sketch with runaway serial output is filling a lot of buffers (possibly all of them) in the USB driver on your host system.


Well if this is the same bug as the original bug in the first Uno, it isn't the Host side's problem.  The 8u2 gets into an un-usable state when it is given a bunch of data and no where to send it.
Title: Re: After running the Hello World in repeat mode
Post by: mromani on Jul 05, 2011, 05:50 pm
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286088093/all