Error compiling on Atmega 2560

I am looking for some help on compiling a script on a Atmega 2560. I can load it with out a problem on a Uno R3 and all works well. If I try to load it on the 2560 I get a compiling error as follows (c:/documents and settings/user/my documents/arduino/arduino-1.0.2/hardware/tools/avr/bin/…/lib/gcc/avr/4.3.2/…/…/…/…/avr/lib/avr6/crtm2560.o: In function __vector_default': (.vectors+0x2c): relocation truncated to fit: R_AVR_13_PCREL against symbol __vector_11’ defined in .text section in c:/documents and settings/user/my documents/arduino/arduino-1.0.2/hardware/tools/avr/bin/…/lib/gcc/avr/4.3.2/…/…/…/…/avr/lib/avr6/crtm2560.o) I will attach the code since it is larger than the site allows to send in this message.

Sprinkler_Pool_Dim_color.ino (11.1 KB)

Compiles OK with both ver 1.03 and 4 of the ERW IDE
ERW1.04

C:\Users\ENDUSE~1\AppData\Local\Temp\build9218931035758484246.tmp\Sprinkler_Pool_Dim_color.cpp.hex
Binary sketch size: 16,966 bytes (of a 258,048 byte maximum)
Estimated used SRAM memory: 342 bytes (of a 8192 byte maximum)
I got bored and just for grins tried it with 1.03 too…

Compiles ok for me… but not under 1.01… didn’t try 1.03
ERW 1.03

C:\Users\ENDUSE~1\AppData\Local\Temp\build3011814792375080440.tmp\Sprinkler_Pool_Dim_color.cpp.hex
Binary sketch size: 16,966 bytes (of a 258,048 byte maximum)
Estimated used SRAM memory: 342 bytes (of a 8192 byte maximum)

Bob

Sprinkler_Pool_Dim_color.cpp.hex (47.3 KB)

I get the same compiling errors with 1.5.2 It seems to happen more. http://arduino.cc/forum/index.php/topic,108524.0.html http://arduino.cc/forum/index.php/topic,154964.0.html But after reading that, I still don't know how to fix it.

It is a bug, https://github.com/arduino/Arduino/issues/1071

@Docedison, what is different in the enhanced ERW version ?

Added: A workaround. You could change a few F("...") into normal strings, or add a few of those. So add more F("..."), for example the part with "POOL TEMPERATURE" are a few lines where you can add them. And also at sentHeader are some lines that where more F("...") can be used.

Thanks for the help I will try your suggestion Erdin. Been a bit bust sorry to be so slow responding

Thanks Erdin it works fine now. I thought with the 2560 I would not be as concerned with memory since it compiled on the Uno with no errors.

Unless you have done something very special, you are not compiling anything on your Mega, and you are not compiling anything on your Uno either.

No nothing speacial...checked again because of your post and again it compiles no problem. I am happy with out come. Thanks again Erdin it worked after adding the F("...") in the areas you suggested

I thought with the 2560 I would not be as concerned with memory since it compiled on the Uno with no errors.

It compiled FOR the UNO, not ON the UNO.

apologies for the grammer did not catch michinyon's point first read. Yes it would be special to compile ON the UNO