Go Down

Topic: Arduino MEGA 2560 dont upload (Read 423 times) previous topic - next topic

mariosm

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

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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

mariosm

#2
Nov 14, 2018, 12:50 pm Last Edit: Nov 14, 2018, 02:29 pm by mariosm
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:


Code: [Select]


"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 : https://pastebin.com/m5ncBE4Q)
Thank you

Budvar10

#3
Nov 14, 2018, 01:37 pm Last Edit: Nov 14, 2018, 01:39 pm by Budvar10
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: https://forum.arduino.cc/index.php?topic=73748.0).

EDIT: Maybe... version of IDE?
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

mariosm

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 )
Code: [Select]
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

fonsypool

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....

Budvar10

#6
Nov 14, 2018, 06:31 pm Last Edit: Nov 14, 2018, 06:32 pm by Budvar10
Quote
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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

fonsypool

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.

Budvar10

@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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

fonsypool

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         


Budvar10

#10
Nov 15, 2018, 09:53 am Last Edit: Nov 15, 2018, 11:01 am by Budvar10
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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Budvar10

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.

Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

fonsypool

#12
Nov 15, 2018, 04:50 pm Last Edit: Nov 15, 2018, 07:15 pm by fonsypool
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:
Code: [Select]

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:

Code: [Select]

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.

Budvar10

#13
Nov 16, 2018, 07:59 am Last Edit: Nov 16, 2018, 07:59 am by Budvar10
Picture:
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Budvar10

#14
Nov 16, 2018, 08:03 am Last Edit: Nov 16, 2018, 08:07 am by Budvar10
Quote
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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Go Up