Pages: [1]   Go Down
Author Topic: MEGA 2560 upload timeout nightmare SOLVED!  (Read 918 times)
0 Members and 1 Guest are viewing this topic.
London, UK
Offline Offline
Newbie
*
Karma: 4
Posts: 49
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have ready EVERYTHING about the Mega 2560 timeout issue on this site and many others. I have tried reinstalling usb drivers, editing boards.txt, tweaked versions of avrdude and I have pressed reset about a million times while uploading, to no avail. I have run avrdude from the cmd line with every possible -c<programmer type> and still no joy. Is there a simple solution to what seems to be a very widespread problem in that the arduino IDE seems totally unable to upload sketches to the Mega?

For the record, I have tried it with arduino 1.0.0 and 1.5.1r2. The board is a genuine Arduino item R3 (from farnell.co.uk) and the USB driver says date: 15/11/2007 version 5.1.2600.0
I have run the loopback test which was fine and I have even reflashed the Atmega16U2 firmware. What else is left? PLEASE don't reply if you have a suggestion that involves any of the above - I have tried it!!!

Luckily I have an AVR dragon and Atmel Studio 6. I can upload the bootloader to the 16U2 perfectly ok, and I can upload hex/elf sketches to the mega2560. So all is not lost, i.e. I can use the mega, but its a song and dance, and I'd dearly love to use the Arduino IDE

PS  Win7 Home premium 64bit


What o what o what is wrong with my setup? It's driving me nuts!
« Last Edit: January 21, 2013, 02:34:27 pm by BareMetal » Logged

See more 'duino / lego / robotics / electronic stuff on my blog http://philipbowles.com/blog

London, UK
Offline Offline
Newbie
*
Karma: 4
Posts: 49
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just tried it in 1.0.3 - same result
Logged

See more 'duino / lego / robotics / electronic stuff on my blog http://philipbowles.com/blog

London, UK
Offline Offline
Newbie
*
Karma: 4
Posts: 49
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have had an idea - I think it might be to my early lack of understanding re the role of the 16U2 and the 2560 - I thought the bootloader lived in the 16U2 : now I realise thats only a USB -> serial converter and that the 2560 itself needs bootloader code.

I think I may have trashed the 2560 bootloader while using Studio 6 / AVR dragon in ISP mode just to get something happening at all!

In which case, I would have thought that the IDE "burn Bootloader" ought to sort me out...but that hangs too. Are there some fuses that might need to be reset first for that to work?

Either way I'm going to try to find the latest 2560 bootloader binary, find the avrdude or Studio 6 / Dragon process to re-burn the bootloader and set any fuses then run it up the flagpole with a "normal " sketch upload. Will post results here just in case anyone else has the same problem

Phil
Logged

See more 'duino / lego / robotics / electronic stuff on my blog http://philipbowles.com/blog

London, UK
Offline Offline
Newbie
*
Karma: 4
Posts: 49
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Bingo. I've sorted it. Not only does my sketch now upload with no fuss at all - it's pretty fast!

My earlier guess was correct. Seems as if these all-too-common symptoms may well be down do a trashed or missing bootloader as well as all the other various suggestions.
Here's how I fixed it:
Tried "burn bootloader" with verbose output to see the raw avrdude commands. Unfortunately it only gets as far as trying to program the fuses. Took note of the hex values, and used avr dragon in ISP mode with studio 6 to set them to match. Then tried to find bootloader as its not immediately obvious, but eventually:

<your drive:folder>arduino-1.0.3\hardware\arduino\bootloaders\stk500v2\stk500boot_v2_mega2560.hex

then power off board, programmer (dragon in my case), shut down arduino IDE. Remove and replace USB to mega2560 till notification "bing-bong" occurs and arduino IDE can see the com port again, and - perfection! All works exactly as expected.

And I'm a happy bunny, wiser and still loving the arduino platform!
Logged

See more 'duino / lego / robotics / electronic stuff on my blog http://philipbowles.com/blog

Pages: [1]   Go Up
Jump to: