Arduino MEGA 2560: cannot connect and upload with avrdude errors

We am unable to establish serial connection and upload a sketch. The board is new, has nothing wired to it (besides USB to the computer) and I'm just trying to upload the Blink sketch.

Arduino IDE: v 1.8.19
Operation system: Windows 10
Board: Mega 2560 R3 with ATmega2560

It appears correctly in device manager and in the IDE, which makes me believe that the drivers are installed correctly.

The following is output in the IDE console.

Sketch uses 1536 bytes (O%t) 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 "\\.\COM11": Access is denied. 

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 into avail 
avrdude: stk500_send(): failed to send command to serial port 
avrdude: ser_recv(): read error: The handle is invalid. 

Things we've tried:

  • Changed USB ports. Changed from COM3, which the device had been assigned to automatically, to com 11.
  • Holding down the reset button during the upload procedure.
  • Various different USB ports, including USB3 and USB2.
  • Tried with the original cable and a printer cable.
  • Tried it via a USB hub and without any hub.
  • Disabled the firewall and ensured there is no Bluetooth related devices or systems connected.

The other concern is that sometimes when we plug in the board, the LED goes in the HIGH state and stays HIGH. Sometimes it flashes 15 times with 1 second period and once with 3 seconds, then it repeats the cycle. Sometimes it does not come ON at all. The TX and RX LEDs, meantime, show signs of life.

The "Access is denied" error happens when the port is open in another application.

Make sure you don't have any other applications running that might have the port open. Only one application can have a serial port open at a time.

Try restarting your computer. Sometimes a glitch causes the port to get stuck open and restarting fixes that.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.