HOWTO: Reset your Arduino when serial port is overflow or upload hang.

New to Arduino, I was playing with loop and serial output. Didn't take long that I overflow the serial buffer and Arduino IDE was not able to upload any code and hang there. I try multiple RESET, update driver,etc but none work and I was also receiving PORT already open/used.

After scratching my head about this problem and search on the internet, I found a very simple SOLUTION that I would like to share that work anytime and you don't need a programmer or other tools.

  • Unplug your USB Cable
  • Go in your DEVICE MANAGER
  • Click on Ports (COM & LPT)
  • Right Click on Arduino....(COMx)
  • Properties
  • Port Settings
  • Put Flow Control to HARDWARE
  • Create an empty sketch (*Optional)
  • Connect the USB Cable
  • Upload (Ctrl - U)

    // Emtpy Sketch to fix upload problem
    // Create by Eric Phenix
    // Nov 2014
    
    void setup() 
    { 
    } 

    // the loop routine runs over and over again forever:
    void loop()
    { 
    delay(1000);                            
    }

You can leave the Flow Control to HARDWARE, won't have this issues anymore.

Et voila! Eric

Or, just press & hold Reset. When the IDE shows "compiled xxx of 32xxx bytes" (or similar), release reset. May take a couple tries to get the timing right.

A faster way:
Hold down the Reset button.
Unplug the USB cable. (this clears the buffer)
Re-plug the USB cable.
Click on the Upload button.
When the RX light blinks, release the Reset button.