I am using a Mega2560 with ERW 1.0.1f. My sketch is approx 51k, SRAM used approx.3.5k. In order to save SRAM I am using extensively sprintf_P and Serial.print(F(. It seems that my sketch has now grown to a size that the compiler/linker cannot longer handle it. Whenever I add code, I get the following error:
c:/program files (x86)/arduino/arduino erw 1.0.1f/hardware/tools/avr/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr6/crtm2560.o: In function
(.vectors+0x88): relocation truncated to fit: R_AVR_13_PCREL against symbol__vector_34' defined in .text section in c:/program files (x86)/arduino/arduino erw 1.0.1f/hardware/tools/avr/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr6/crtm2560.o
In order to work around this error I am converting sprintf_P into sprintf and Serial.print(F( in ordinary Serial.print(). The downside is that my SRAM usage is growing. Furthermore this work-around isn't very successful in the long term as I will long have run out of SRAM before I have used up a more significant share of the program memory.
I have seen similar error messages reported with the other boards. I have also seen the recommendation to use the latest WINAVR /avrdude.conf (I tried this and it made no difference)
Does somebody know how I can overcome this restriction? Thanks in advance for any assistance.