Accidentally unplugged USB during upload, now no sketch can be uploaded. Help!

Hi all,

My Arduino Mega 2560 has been working fine until I accidentally unplugged the USB cable (also serving as the only power source) in the middle of upload. Now, even the simplest "blink" sketch cannot be uploaded. Please see error code at below.

I have tried various ways found online, and none of them resolve the issue. Did the unplugging corrupted the Arduino?

Please help!

  • Disconnect USB (and power), wait for a few minutes, then reconnect
  • Press reset while code compiling is almost done
  • Checked correct port is selected, also used device manager to cross check COM port selected is correct (in this case COM7)
  • Checked correct board and processor
  • Tried different port
  • Sketch can be loaded to a different Mega
Sketch uses 1470 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
avrdude: ser_open(): can't open device "\\.\COM7": The system cannot find the file specified.


avrdude: ser_drain(): read error: The handle is invalid.


avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
the selected serial port avrdude: stk500v2_getsync(): timeout communicating with programmer
 does not exist or your board is not connected

Don't cross-post !!!!!!!!!!!

avrdude: ser_open(): can't open device "\\.\COM7": The system cannot find the file specified.

Based on this line, I don't think there is a issue with your arduino, but there is a issue with your computer.

Does the arduino still show up in device manager as a device with a COM port?