1
votes

While uploading code on Arduino Mega, I am getting this error:

c:/users/sohini/desktop/arduino-1.5.2/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr6/crtm2560.o: In function `__vector_default':

(.vectors+0xdc): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_55' defined in .text.__vector_55 section in C:\Users\Sohini\AppData\Local\Temp\build208222592316456159.tmp/core.a(HardwareSerial.cpp.o)

Can anybody please explain what the error is about and how to correct it?

1
You need to provide more infor about code to deduce something. crtm2560 in libc file atmega2560. Are you sure you have properly build you project.praks411
I get this when uploading the SoftwareSerial example code.Orbiting Eden

1 Answers

1
votes

When trying to run the SoftwareSerialExample the problem for the mega 2560 is in the lines intended for the Leonardo. Comment out this code:

void setup() 
{
  // Open serial communications and wait for port to open:
  Serial.begin(57600);
/*while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }*/