limited code size in MEGA2560 ?

Hi,

My sketch gets bigger and bigger. Now I have about 59k binary code to upload (59.362 Bytes (23%)).
But now, when I'm uploading the latest code, the upload hangs. I never see the message "upload finished" and the Arduino is dead unless unpowered.
If I upload an older version of the code (59.040 Bytes (23%)), it seems (!) to work properly, but I notice that the EEPROM is overwritten with some compiler output :o
In a specific area which I print out for debugging (30 bytes from EEPROM addr 112) I can see the following: "GCC Version = CPU signatur".
The behaviour is 100% repeatable. The same on another Arduino.

Has anybody seen this before?

rgds
purehunter

If you do File > Preferences > Show verbose output during > upload(check) > OK it may give you more information on what is going on during the upload process.

I don't have a good answer but I can tell you that the Marlin firmware for my 3D printer uses more code space than what's giving you trouble. I'm using a Mega2560 and the results of a compile is:
Sketch uses 141542 bytes (55%) of program storage space. Maximum is 253952 bytes

This code uploads to the 2560 with no issues on my Win10 64 bit PC.

Now I have about 59k binary code

What's your RAM usage at? Frequently as sketches grow, both the flash and RAM use go up, but there is less RAM and it can easily run out first. using up all the ram frequently causes strange behavior...

Thanks for your replies!

I'm pretty sure I know what to do now.
My HW is not the latest (from2012) and I found in older posts that there "was" a bootloader bug which caused such issues when the code exceeded 64k. Even though the compiler shows 59k, I guess this is the problem, don't know how exactly the addressing space is organized, but the EEPROM overwriting can only be done by the crashed bootloader I think.
I will try to update the bootloader as the next step.

I think RAM usage etc. is not the problem, as it will get important only after program start which does not happen in my case.