Arduino wont connect to my Arduino Mega 2560 board..

Hello,
Whenever I try to upload marlin firmware to my Arduino Mega 2560 it gives me an error and i have checked my tools and i am connected to the Arduino Mega 2560 board and port and have the ATmMega 2560 selected for my processor, and every time I try to upload my Marlin firmware it gives me an error message that says...

Arduino: 1.6.5 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 2,360 bytes (0%) of program storage space. Maximum is 253,952 bytes.

Global variables use 55 bytes (0%) of dynamic memory, leaving 8,137 bytes for local variables. Maximum is 8,192 bytes.

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




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




Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

...I have also tryed the hello world firmware it gave me the same error. :frowning:

Thanks, John :slight_smile:

avrdude: ser_open(): can't open device

the above error comes because of 2 reason

  1. while uploading code serial pins are occupied. if occupied just remove & upload code.

  2. your bootloader crashed, you can use AVR pocket programmer to upload it.