Relocation truncated to fit

Hi there,

I get an error message when I try to build my program:

E:\Temp\ccIyLSlA.ltrans0.ltrans.o: In function main': <artificial>:(.text.startup+0x738): relocation truncated to fit: R_AVR_7_PCREL against no symbol’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\megaatmega2560\firmware.elf] Error 1

I’ve found a “solution” but I don’t know if it’s applicable to PlatformIO !

I’m with an Arduino Mega 2560.
I got this error when I run this:

for(int i = 2; i >= 0; i --)
{
receivedChar = HC12.read();
if(isDigit(receivedChar))
{
module_id += (receivedChar-‘0’) * pow(10, i);
}
else
{
//Serial.print(“This character is not a digit: “);
//Serial.print(receivedChar);
//Serial.print(” (0x”);
//Serial.print(receivedChar, HEX);
//Serial.println(“)”);
isWrongFormat = true;
}
}

But it compiles fine when I uncoment Serial.print lines :thinking:
It’s not the full program because my program has 400 lines, and I don’t know if we can reproduce it with a little script…

Thanks !

(Another request: Will you support Debugging for Arduino Mega 2560 ?)