Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avrdude: stk500v2_ReceiveMessage(): timeout #15

Open
titusece opened this issue Dec 23, 2016 · 6 comments
Open

avrdude: stk500v2_ReceiveMessage(): timeout #15

titusece opened this issue Dec 23, 2016 · 6 comments

Comments

@titusece
Copy link

Hi,

I have a Arduino UNO (Arduino as ISP) , a Arduino MEGA2560 (to be programmed with Ariadne bootloader) and W5100 Ethernet shield.

As you have mentioned, I've followed the below link to program the Mega board with Ariadne-Bootloader(.h) using UNO(Arduino as ISP).
http://www.gammon.com.au/forum/?id=11635

Able to program the default Mega bootloader code using gammon's url.

I have converted "ariadne_atmega2560_w5100.hex" bootloader hex file to "ariadne_atmega2560_w5100.h" using MUSHClient and flashed the code into Mega2560 board.

Now I have tried to upload the blink code using USB cable (as usual) but I have got the below error.

Can you please help me on this issue ?

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

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

     Using Port                    : COM16
     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
An error occurred while uploading the sketch
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done. Thank you.

Regards,
Titus S.

@titusece
Copy link
Author

titusece commented Dec 23, 2016

Moreover I have not connected the Ethernet Shield W5100 on Mega board while bootloader programming and serial uploading sketch.
Is that reason I'm getting timeout error ?

Also I tried with "convertHexToByteArray.py" python script to convert .hex to .h file (instead of MUSHClient tool)

Log:
Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Dec 23 2016 at 09:14:38 with Arduino IDE 10611.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x98 0x01
Processor = ATmega2560
Flash memory size = 262144 bytes.
LFuse = 0xFF
HFuse = 0xD8
EFuse = 0xFD
Lock byte = 0xEF
Clock calibration = 0x82
Bootloader address = 0x3E000
Bootloader length = 8192 bytes.
Type 'Q' to quit, 'V' to verify, or 'G' to program the chip with the bootloader ...

Erasing chip ...
Writing bootloader ...
Committing page starting at 0x3E000
Committing page starting at 0x3E100
Committing page starting at 0x3E200
Committing page starting at 0x3E300
Committing page starting at 0x3E400
Committing page starting at 0x3E500
Committing page starting at 0x3E600
Committing page starting at 0x3E700
Committing page starting at 0x3E800
Committing page starting at 0x3E900
Committing page starting at 0x3EA00
Committing page starting at 0x3EB00
Committing page starting at 0x3EC00
Committing page starting at 0x3ED00
Committing page starting at 0x3EE00
Committing page starting at 0x3EF00
Committing page starting at 0x3F000
Committing page starting at 0x3F100
Committing page starting at 0x3F200
Committing page starting at 0x3F300
Committing page starting at 0x3F400
Committing page starting at 0x3F500
Committing page starting at 0x3F600
Committing page starting at 0x3F700
Committing page starting at 0x3F800
Committing page starting at 0x3F900
Committing page starting at 0x3FA00
Committing page starting at 0x3FB00
Committing page starting at 0x3FC00
Committing page starting at 0x3FD00
Committing page starting at 0x3FE00
Committing page starting at 0x3FF00
Written.
Verifying ...
No errors found.
Writing fuses ...
LFuse = 0xFF
HFuse = 0xD8
EFuse = 0xFD
Lock byte = 0xEF
Clock calibration = 0x82
Done.
Programming mode off.
Type 'C' when ready to continue with another chip ...

Any help ?

@titusece
Copy link
Author

In addition to that, after flashed bootloader, I've not seen Ethernet LED blinks (no activity).
What could be the problem ?

@Nekraus
Copy link

Nekraus commented Dec 23, 2016 via email

@titusece
Copy link
Author

Thank you so much Nekraus!
Let me try it out :) 👍

@titusece
Copy link
Author

titusece commented Dec 23, 2016

Hi Nekraus,
I've programmed the bootloader to Mega board without shield on it.
After flashed the bootloader code, I've connected shield and checking the ethernet LED activity and tried to upload the code via USB interface on Mega board (which has the new ariadne bootloader)
But still I'm getting the same problem.

I understand that we should connect shield on Mega board as its using the SPI pins were used and mapped for Ethernet controller and the same SPI pins were also used for ICSP programming.

Is it mandatory to connect the shield while programming (thats why you'd pended the pins) ?

Can you please provide your bootloader .h file of Mega2560 board ?

Thanks for support.

@titusece
Copy link
Author

titusece commented Dec 23, 2016

Hi Nekraus,

I've followed the below link for Arduino UNO(programmer) to Arduino MEGA(to be programmed with TFTP bootloader)
https://1.bp.blogspot.com/-369p0vA9eSo/V1NK1rlGftI/AAAAAAAATZI/QyG2WTfzIIc58ZLfBgdYvY4YqGVBFmYhwCLcB/s1600/Uno%2BArduino%2BISP%2Bto%2Bprogram%2BMega.png

Able to flash and boot the default bootloader from Gamma. (bootloader_atmega2560_v2.h)

I edited the file Atmega_Board_Programmer.ino for my ariadne TFTP bootloader .h file which is converted from ariadne_atmega2560_w5100.hex

C:\Program Files (x86)\Arduino\hardware\ariadne\bootloaders\ariadne\ariadne_atmega2560_w5100.hex

#if USE_ATMEGA2560
// #include "bootloader_atmega2560_v2.h"
#include "ariadne_atmega2560_w5100.h"
#endif

Then I uploaded this modified code into Arduino UNO and type "G" to upload the ariadne TFTP bootloader code like below.

Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Dec 23 2016 at 22:45:01 with Arduino IDE 10611.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x98 0x01
Processor = ATmega2560
Flash memory size = 262144 bytes.
LFuse = 0xFF
HFuse = 0xD8
EFuse = 0xFD
Lock byte = 0xEF
Clock calibration = 0x82
Bootloader address = 0x3E000
Bootloader length = 8192 bytes.
Type 'Q' to quit, 'V' to verify, or 'G' to program the chip with the bootloader ...
Erasing chip ...
Writing bootloader ...
Committing page starting at 0x3E000
Committing page starting at 0x3E100
Committing page starting at 0x3E200
Committing page starting at 0x3E300
Committing page starting at 0x3E400
Committing page starting at 0x3E500
Committing page starting at 0x3E600
Committing page starting at 0x3E700
Committing page starting at 0x3E800
Committing page starting at 0x3E900
Committing page starting at 0x3EA00
Committing page starting at 0x3EB00
Committing page starting at 0x3EC00
Committing page starting at 0x3ED00
Committing page starting at 0x3EE00
Committing page starting at 0x3EF00
Committing page starting at 0x3F000
Committing page starting at 0x3F100
Committing page starting at 0x3F200
Committing page starting at 0x3F300
Committing page starting at 0x3F400
Committing page starting at 0x3F500
Committing page starting at 0x3F600
Committing page starting at 0x3F700
Committing page starting at 0x3F800
Committing page starting at 0x3F900
Committing page starting at 0x3FA00
Committing page starting at 0x3FB00
Committing page starting at 0x3FC00
Committing page starting at 0x3FD00
Committing page starting at 0x3FE00
Committing page starting at 0x3FF00
Written.
Verifying ...
No errors found.
Writing fuses ...
LFuse = 0xFF
HFuse = 0xD8
EFuse = 0xFD
Lock byte = 0xEF
Clock calibration = 0x82
Done.
Programming mode off.
Type 'C' when ready to continue with another chip ...

Any help please ?

Regards,
Titus S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants