Cannot upload to Mega2560 board

Sketch uses 2790 bytes (1%) of program storage space. Maximum is 253952 bytes.
Global variables use 216 bytes (2%) of dynamic memory, leaving 7976 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1

  1. Original or clone board?
  2. What is the serial-to-usb converter on the board? It's the chip closest to the USB connector.
  3. Correct port selected?
  4. Does that port disappear when you disconnect the board?
  5. Anything connected to pins 0 and 1? If so, disconnect.
  6. Anything else connected? If so, what? Disconnect and see if you can upload.
  7. What is the history of the board? Did it work in the past?
  8. Which operating system are you using?

[quote="sterretje, post:2, topic:1401035"]

  • clone board
  • What is the serial-to-usb converter on the board? CH340(G?)
  • yes...com7
  • Does that port disappear when you disconnect the board...yes
  • brand new, nothing connected
  • Which operating system are you using...windows11
  • the sketch works with uploading to an UNO R3 original on Com5 and UNO R3 clones on Com6

Any yellow triangles in Windows device manager. Is it recognised as a CH340 in Windows device manager?

Is it marked as such?
If not, maybe rolling back the driver will solve the issue; see Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM serial port - #49 by ptillisch.
If yes, I do not know the solution. Rolling back the driver might solve it.

I have a MEGA 2560 working perfectly since day one.
Windows 11, Arduino IDE 2.3.6.
If you can send me your sketch, I can do a hardware test from my side, and let you know.
Otherwise, I would say check your printer cable port or the drivers.
A faulty printer port can also be the issue.

The link that I did provide in post #5 contains instructions that might solve our problem. It was not the intention to add information to the topic in that link.

I compiled and uploaded my sketch and it worked successfully on an Arduino R3 original on COM5 and also on an Arduino R3 clone on COM6, so I know the communication is working.
However it just cannot seem to recognise my Mega 2560.
The ON led turns on and the L Led flashes every 1 second. I tried your suggestion for the driver but I am not sure how to find an earlier driver. The Driver files details for the USB-SERIAL CH3240 (COM7) are as follow:-
C:\WINDOWS\SYSTEM32\CH341portsa64.DLL
C:\WINDOWS\SYSTEM32\CH341PTA64.DLL
C:\WINDOWS\SYSTEM32\Drivers\CH341S64.SYS
C:\WINDOWS\SysWOW64\CH341PT.DLL
I am not sure how significant it is, that it says CH341 rather than CH340 but?????
The Driver version is 3.9.2024.9. When I dbl click the UPDATE DRIVER button, it tells me that the best driver is already installed. HELP!!

Sadly, no yellow icons but I tried the suggestions from another reply, to no avail.
I compiled and uploaded my sketch and it worked successfully on an Arduino R3 original on COM5 and also on an Arduino R3 clone on COM6, so I know the communication is working.
However it just cannot seem to recognise my Mega 2560 board.
The ON led turns on and the L Led flashes every 1 second. I am not sure how to find an earlier driver.
The Driver files details for the USB-SERIAL CH3240 (COM7) are as follow:-
C:\WINDOWS\SYSTEM32\CH341portsa64.DLL
C:\WINDOWS\SYSTEM32\CH341PTA64.DLL
C:\WINDOWS\SYSTEM32\Drivers\CH341S64.SYS
C:\WINDOWS\SysWOW64\CH341PT.DLL
I am not sure how significant it is, that it says CH341 rather than CH340 but?????
The Driver version is 3.9.2024.9. When I dbl click the UPDATE DRIVER button, it tells me that the best driver is already installed. HELP!!
I also tried unplugging, replugging the board, then rebooting the computer and trying again with the same results.
I do appreciate the help so far, so thank you.

Yes, so that means Windows 11 has your back, but that also means it we are completely at the mercy of how Microsoft handles it on their end of marriage with the OS.

Since the same CH340G driven MEGA 2560 is working flawlessly on my system, I would assume that your CH340G is faulty (it is a fair possibility).

No additional drivers or setups were needed for my MEGA 2560. It worked directly with Arduino IDE 2.3.6 and no other additional dependencies to recognize the board were needed.

Check with any other clone boards which uses CH340G, if that happens then it is highly likely it is a faulty CH340G or its board integration or any other manufacturing defect.

Good luck and all the best

EDIT: Assuming you have the board MEGA 2560 with Atmega2560 as the main MC.

Can you post a link to where you purchased the mega?

Is this one of the clone mega boards that include an esp8266 onboard, or some other non-standard version?

I foolishly bought some cheap Nano clones.

So cheap, the chip on the back was anonymous. Did the usual Old bootloader thing, but no joy. Really couldn't spend time checking drivers, so spent a few quid more, and bought a new, genuine Nano Every, followed by a Nano R4.

Having said that, a Geekcreit Mega 2560 clone has worked flawlessly for a decade now, 24/7.

Not all clones are bad.

That is from before the time that those "bad" CH340s came along. I have a few Nanos with CH340 that work perfectly with the latest drivers.

Yeah, bought from TEMU in China.
Description is:= ATMEGA 2560-16AU Arduino Compatible MEGA2560 R3 Board.
Not sure about the esp8266 as the chip near the USB socket is a CH340G

Yeah, bought from TEMU in China.
Description is:= ATMEGA 2560-16AU Arduino Compatible MEGA2560 R3 Board.
So far, none of the proposed solutions have worked.
Since the L led keeps flashing, it is probably a dud board cost $35 AUD Ugh!
On my working Arduino UNO R3 boards, the L led goes off after compiling and uploading sketches successfully. the ON led is ON

Since the L led keeps flashing while the ON led stays ON on this dodgy Mega Board, it is probably a dud board ....cost $35 AUD Ugh!
Thanks for all the help.

Unfortunately rolling back did nothing, but thanks anyway.
I bought it from TEMU in China.
Description is:= ATMEGA 2560-16AU Arduino Compatible MEGA2560 R3 Board.
So far, none of the proposed solutions have worked.
Since the L led keeps flashing, it is probably a dud board cost $35 AUD Ugh! However, the ON led stays ON on this dodgy Mega Board, it is probably a dud board ....cost $35 AUD Ugh!

On my working Arduino UNO R3 boards, the L led goes off after compiling and uploading sketches successfully. the ON led is also ON to indicate a working board!

The L light flashing shows that the atmega2560 chip is running, that will continue until you have replaced the code.

If nothing else works, you can try reflashing the bootloader through the ICSP header. You can also upload code that way.

If you have a magnifying glass, examine the board to make sure there are no solder bridges or bad connections to the CH340 or atmega2560.

Thanks, I am new to Arduino, so not sure how to handle reflashing or bootloaders, ICSP headers etc.
I will examine the board for solder bridges or bad connections but that might be an uphill task...still, nothing ventured, nothing won!

It is late night here so tomorrow will be the attack session!

Does your board have the ESP8266 chip on it? E.g. like

If so, make sure that you set the dip switches correctly. There are articles on the web what their functions are and how to set them.

Could you try uploading via pins 0 and 1 using usb to serial converter.

Thanks for the idea...guess I will have to buy or build the usb to serial converter before I can try this, might be worth a shot.