I keep getting this message. I have no idea why. I have never seen this issue before and it just suddenly appeared. The only change I made to my arduino was include Virtual wire into my sketch and connect the TX wire up and Pins 12, 13, 3v3 and gnd.
I can pull out my usb and then the example Blink can be uploaded and this is fine (even with those pins connected), however as soon as I try to upload the sketch I actually want I get this error.
I am running arduino IDE 1.0.5 on Ubuntu 12.04
The arduino is a Mega 2560 with an Ethernet shield attached
The Arduino Mega 2560 had issues in the past. The new bootloader has fixed most of them.
You could try to increase flash code size, by declaring dummy PROGMEM data. Or try rearranging data with the 'F()' macro for texts.
When you have a programmer, you could try to re-write the bootloader.
Somewhere in the middle of the board are 6 pins. That is the ICSP header.
You need a programmer, and with that ICSP header you can program the chip and re-write the bootloader.
Also an Arduino board can be used as a programmer, that is called "Arduino as ISP".
I just tried something and removed some of the F() macros that I had in and the upload worked!
I was doing a few Serial.println(F("Initializing")); messages for various sections of my setup. I have run a check and re-added them into the code and it did not upload and gave the timeout issue. I guess I was using up all of the flash memory without realising.
No, it was a glitch in the Mega bootloader.
Rearranging memory sometimes helps.
When you make the sketch larger or smaller in the future, it might happen again.
I'm not sure, but I think I remember that when I passed the 32k boundery, I had problems. And after I added dummy data in flash to go beyond the 64k, the problems were gone.
After that I have rewritten the bootloader with a USBasp programmer.
Ahhh tits! That is rubbish as I am just approaching the 32k mark
I have the rev.2 mega and I have a nano and uno so I believe I can burn a new bootloader with the uno. Wheredo I download the latest bootloader for the ardunio?
As far as I know, the new bootloader can be used also for the Mega version 2. That is what I did, and it is okay.
This is the path to follow:
Connect Uno, select Uno board, upload ISP sketch.
Connect Uno to Mega with MISO MOSI and those signals.
Select Mega board, select programmer (Arduino ISP), click Burn Bootloader.