Arduino Mega not working on Win 10 but works on Linux?

Hi All,

I have a confusing issue, on Windows 10 I can upload sketches to my Uno's and my Nano's without any problems but no joy with a Mega 2560, I have a genuine board and a clone neither work.

I have gone back to the most basic blink sketch, and when uploading it just says uploading for a while and then comes back with "An error occurred while uploading the sketch"

I had been using the board up until recently without any issues.

To troubleshoot I have tried different cables and different USB slots, I then went to my Linux drive on the same machine and installed Arduino IDE and I can upload the same sketch without any problems, this leads me to believe that the board, cable and ports are fine.

I have uninstalled and re-installed the IDE on Windows and this hasn't helped, I have also reinstalled the driver for the Mega with no joy.

Any help would be appreciated!

Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Sketch > Upload
  • After the upload fails you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button.
  • Paste the error messages in a reply here USING CODE TAGS (</> button on the toolbar).

Thanks pert

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Archiving built core (caching) in: C:\Users\ins4n\AppData\Local\Temp\arduino_cache_721530\core\core_arduino_avr_mega_cpu_atmega2560_0c812875ac70eb4a9b385d8fb077f54c.a
Sketch uses 1462 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.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM7 -b115200 -D -Uflash:w:C:\Users\ins4n\AppData\Local\Temp\arduino_build_697755/Blink.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM7
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
An error occurred while uploading the sketch

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

Well that didn't give us too much more information to work with. Usually avrdude will give some error message to indicate what went wrong but in this case it just failed silently.

Just for kicks, you could try using the beta release of Arduino AVR Boards to see if that version of AVRDUDE might not cause the same trouble:

Still no joy :frowning:

I did think it was strange not having any errors

Hello there!

Can you go to Device Manager on your windows drive and look in the Ports (COM and LPT) menu and see if there is an Arduino Mega2560 (COMx) anywhere?

Hi bos1714

I can confirm I get Com 7 - Arduino Mega 2560 (COM7)

I should also mention if I load IDE and just try to look at Serial (on port 7) it tells me it is busy! (edit that is only after the first upload attempt)

Have you tried the loopback test of holding the reset button on the mega, connected RX and TX with a wire, and opening the serial monitor? If not, do that and type something into the serial textbox and press enter. Whatever you typed should appear in the serial window. Do it again and this time look at the lights on the board and see if Rx and Tx LEDs blink really quick when you hit enter

OK

I have tried sending to COM 7 and it just hangs for ages, I literally can't close the serial monitor or Arduino IDE, no flashing lights on the board!

I left it for a good 30 mins and no action!

On your windows box are you using USB 3.0 ? If so swap to a USB 2.0 port.

Is your win 10 box a laptop of a full computer ?

Have you turned off the individual power settings for USB to make it always available ?

In the IDE are you selecting the correct flavour of MEGA ?

If you do a “get board info” from the IDE do you get anything back ?

ballscrewbob:
On your windows box are you using USB 3.0 ? If so swap to a USB 2.0 port.

Is your win 10 box a laptop of a full computer ?

Have you turned off the individual power settings for USB to make it always available ?

In the IDE are you selecting the correct flavour of MEGA ?

If you do a "get board info" from the IDE do you get anything back ?

I am using USB 2.0 and have tried a few different ports

My Win 10 box is an actual PC not a laptop

USB power settings are disabled

The IDE has the correct Mega 2560 (I use the same setting on Linux and it works without issue)

for "get board info" I get the following

BN: Arduino/Genuino Mega or Mega 2560
VID: 2341
PID: 0010
SN: 95232343833351301210

All looks OK.

The last item means it interrogated the board and came up good for the USB descriptors.

The rest means you ruled out a lot of the easy things.

My first thought from there would be to re-flash the board using ICSP.
EG another Arduino or a proper ICSP programmer.

Maybe use the ICSP on the second ICSP header to push a sketch up such as BLINK too to verify the main MCU.

Is there a chance of frying the board if the ICSP flash goes wrong?

I do have an FTDI232 I was wondering if I could upload a sketch using that on the TxRx pins?

Never had an issue with frying a board with ICSP so a really doubt it would damage it.
Another Arduino can be used too if you dont have an ICSP (see link at bottom)

Not sure about the FTDI method but dont think it would work.
It wont harm but it may be a dead end.

If anyone reading knows different please step in as I dont always get some things right.

ICSP tutorial

OK thanks for the help guys.

I will try the bootloader later when I can get my Uno out of the cupboard!

OK thanks again for all your help guys!

I found another Mega I forgot I had, plugged it in and that works perfectly!

I did upload a sketch to the Mega that was working on Linux but found that on the screen I am using with it, wasn’t working properly, all in all I think I have 2 Mega’s that have met the end of their lives.

I can carry on with my project and order some more Mega’s up for future projects