Arduino MEGA 2560 dont upload

Hello.
First of all, im new here !
Ill try to explain my problem :
Ive got Arduino 2560 Mega since 2013 . I make a few sketch for it .
Yesterday, i get it again and i cant upload. The trace say timeout error, comunication with programmer error
Ill search in this forum fix for this problem and ive seen that there are a few people that have the same problems. Ive read fixes for "!!!" problem, a strange fix that consist in push reset button when my sketch is going to upload, but any fix of this work.
I change PC and get the same response. I change the cable too, and the same response

I think maybe i need to use other bootloader or programmer but ill try diferent options.

Any ideas?

if any need some information, i can give it ,
Thank you
Mario

Check the port if it is visible in IDE and working. And also, make sure that IDE setting is correct: programmer, board, port.
Post the log from IDE and try to describe the behavior of on-board LEDs.

Budvar10:
Check the port if it is visible in IDE and working. And also, make sure that IDE setting is correct: programmer, board, port.
Post the log from IDE and try to describe the behavior of on-board LEDs.

Thakyou for your reply.
The port is visible in IDE. Programmer and board are corrects . When i try to upload blink , L led turn on, and RX led turn on only when i get timeout at debugger.
This is the trace :

LOG:

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o "C:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019/Blink.ino.elf" "C:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019\\sketch\\Blink.ino.cpp.o" "C:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019/core\\core.a" "-LC:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019" -lm
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019/Blink.ino.elf" "C:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019/Blink.ino.eep"
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019/Blink.ino.elf" "C:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019/Blink.ino.hex"
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\it3\\AppData\\Local\\Temp\\arduino_build_398019/Blink.ino.elf"
Sketch uses 1460 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 -PCOM6 -b115200 -D -Uflash:w:C:\Users\it3\AppData\Local\Temp\arduino_build_398019/Blink.ino.hex:i 

avrdude: Version 6.3-20171130
         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                    : COM6
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
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

avrdude done.  Thank you.

An error occurred while uploading the sketch

Here my config :
Board : Arduino /Genuino Mega or Mega 2560
Processor : ATMega 2560 (Mega 2560)
Port : COM6
Programmer : AVRISP mkII
(Here full log : C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hard - Pastebin.com)
Thank you

When the upload process start the L should flicker (3x) and then Tx should blink as it receives data. Normally the Rx blinks at response little less as Tx during write phase and vice versa during read/verify phase.

Post detailed log from uploading. Switch on it in the Preferences. Please, use code tags for posting log: [</>] button.

Is your Mega genuine or clone?

You can try loop-back test (here on the forum: Loop-Back Test Instructions - Installation & Troubleshooting - Arduino Forum).

EDIT: Maybe... version of IDE?

About loopback : Ill try to do it, and i dont get echo response .
About genuine or clone : I dont know really but i think is clone.
Ide : ive got 1.8.7 but ill try with 1.0 and 1.6 and no result.
Log : I dont know what you refer with detailed log. Ill have enable verbose at upload and compile : (Thats the same )

Sketch uses 1460 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 -PCOM5 -b115200 -D -Uflash:w:C:\Users\msua9\AppData\Local\Temp\arduino_build_61385/Blink.ino.hex:i 

avrdude: Version 6.3-20171130
         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                    : COM5
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
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

avrdude done.  Thank you.

An error occurred while uploading the sketch

I have same problem. Arduino stays with L Led Blinking and not blinking TX or RX.

When try to upload any sketch I get this error:

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

Arduino is visible from my laptop on COM3 as "COM3 (Arduino/Genuino Mega or Mega 2560)"
Another Arduino Mega is visible at COM5 with same identification

I tried to burn bootloader but not works, I tried from Arduino Mega (new one) as ISP to
Arduino Mega.

I tried to connect PIN10 to Reset
And another 5 pins from ICSP

And on programmer connected a capacitor from RESET to GND.

Can any says what is the problem with this boards??

Any says how to wiring Arduino Mega to Arduino mega to burn bootloader, only I found how to wiring from Arduino ONE to MEGA or MEGA to ONE.

My sketch is MARLIN 2 to my 3D Printer and found this error when Stepper not working, but 3D printer and can manage menu from LCD but when try to connect to laptop pronterface not connect to Arduino....

About loopback : Ill try to do it, and i dont get echo response .

Make sure you really did all steps correctly. Try it again. If there is no response, then the problem is on-board usb/serial programmer and it is not good. It is hard to repair and probably better to buy new board.

Programmer is a new Arduino, first use is to use as ISP to fix my old Mega.

I'm not sure that wiring is correct using two Arduino.

@fonsypool
Arduino as ISP works also for Mega to Mega. Maybe you could try Nick Gammon's web page:

https://www.gammon.com.au/bootloader

which has permanently highly rated.

Yes I tried to search but not exist example using Mega as ISP to programming another Mega.

I tried with example using Mega to programming UNO by ICSP port and capacitor (10uF) but does not work for me.

I not tried using PINs 50-52 (I will test it today):

Mega2560 Target Arduino Uno

D10 Reset
D51 D11 (MOSI)
D50 D12 (MISO)
D52 D13 (SCK)

Gnd Gnd
+5V +5V

Why on earth D10 ? For the mega as ISP it is D53.

EDIT: Hmm, sorry Nick Gammon's page say D10. I looked into my ISP sketch which is little bit different. I have defined it as SS - it is 53.

EDIT#2: After brief look, I'am using modified ArduinoISP which has origins in SW v1.0.6. Pin 53 for Mega was replaced by 10 during the time.

If you are using official ISP sketch then it is correct:

Mega2560 Target Arduino Uno

D10 Reset
D51 D11 (MOSI)
D50 D12 (MISO)
D52 D13 (SCK)

Gnd Gnd
+5V +5V

Just to be sure, look into the sketch. How is the RESET defined?

Anyway, post full verbose log.

Yes, I using original sketch, but all examples that I found are Programmer Mega2560 to Target Arduino Uno.

But, I not found any example where is using Programmer Mega2560 to Target Arduino Mega2560.

I tried also, using PINs 50,51 and 52 as MISO, MOSI and SCK but does not work too.

From Wrong Mega:

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\FNS\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
avrdude: ser_open(): can't set com-state for "\\.\COM3"
avrdude: ser_drain(): read error: Controlador no válido.


el puerto seleccionado 
 no existe o tu placa no esta conectada
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: Controlador no válido.


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: Controlador no válido.


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: Controlador no válido.


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: Controlador no válido.


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: Controlador no válido.


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: Controlador no válido.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done.  Thank you.

And when try to burn bootloader:

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\FNS\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Error quemando bootloader
Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0xffffff (probably .avr8x_mega)
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Picture:

I tried also, using PINs 50,51 and 52 as MISO, MOSI and SCK but does not work too.

No, these 3 are surely correct as in #9.

Wiring on the picture looks correctly connected but if you are trying other than -cstk500v1, 10uF capacitor is needed between RESET and GND on the source (programmer) board.

In Photo, 10uF capacitor is connected.

Check edited photo.

Yes, I see the capacitor. Not clear which pins from the photo but I hope that RESET and GND with + on RESET.

All FF in response means usually short circuit or missing clock but simply bad wiring as well as "all zero response". The only advice for now is: check your wiring again. It is quite simple. Connections between ICSP connectors are 1:1 except of RESET. The RESET on target is connected to pin 10 on source. You can use DMM or LED with resistor in series (~1kOhm) on target between VCC and RESET, to indicate reset pulse passing to the target. Must blink once at beginning of uploading process. Make sure your wires are good and have good contact with pins on connectors.

ok, I will try this, but not have any LED available to test correctly, wiring are ok (I tried this for 6 times or more).

Capacitor is connected from RESET to GND (PIN near 5V).

You can use multimeter for DC voltage instead of LED. The pulse is long enough to be visible on display.