Unrecognized internal error

Hi,

I've been trying to load a sketch into a mega and have just started to get this error....

c:/all_apps/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr6/crtm2560.o: In function __vector_default': (.vectors+0x7c): relocation truncated to fit: R_AVR_13_PCREL against symbol __vector_31' defined in .text section in c:/all_apps/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr6/crtm2560.o

It doesn't seem to reference any of my code, so I'm assuming it's some internal issue. The following may also be pertinent...
I'm using version arduino 1.0.1 on windows XP
I'm uploading to a Mega.
As far as I can see all my other sketches will compile and run just fine.
I've dug out some of my old backups of the sketch from several months ago, and they too generate this error. (but I'll swear they worked fine at the time)
I've NOT included any code with this post because 1) it includes a couple of dozen libraries and is quite long, and 2) the error message doesn't appear to reference any of my own code.
I've tried re-installing and re-booting.
Each of the included libraries have a test sketch to go with them, for all of my recently changed libraries I've managed to re-compile and re-test without problems.

Please help, I don't have much hair left and can't afford to rip any more out!

Thanks

Please help, I don't have much hair left and can't afford to rip any more out!

But you have time to waste not posting your code?

Google "relocation truncated to fit: R_AVR_13_PCREL against symbol" and then get back to us.

Ok, I’ve googled, I’ve read, I’ve learnt, and I’ve experimented, but still no luck.

Basically it seems this is a known issue, but with no known fix that will work in all occurrences. It seems to effect larger sketches, and those that use interrupts, it’s got something to do with the ‘linker’ (getting well past the borders of my knowledge here) and something to do with the way code gets distributed in memory. Some developers have had success by installing later version of code, re-arranging #include statements, or installing newer version of avr.

Here’s what I’ve tried,

Firstly, I tried altering the order that my libraries are listed in – didn’t make any difference.

Then I re-tested (compiled, uploaded and ran) each of the 30 plus libraries the sketch calls. No problems with any of them.

Then I tried all the later versions up to 1.0.4, all give the same symptoms.

Next, I’ve tried the solution suggested in this thread Arduino Forum (basically I added some extra lines to the top of hardware.h) the results started off looking promising, the code compiled without error, claimed to upload without error, but then the sketch just didn’t run. (I subsequently found other posts suggesting this fix didn’t work)

Then I tried the fix proposed here …Which Compiler? - #3 by Coding_Badly - Development - Arduino Forum basically this suggested downloading a new version of WinAVR (version 20100110) and moving the file avrdude.conf. I tried this, the code compiles fine, claims to upload (i.e. displays the message ‘Done uploading’) but also displays the error….

avrdude: Can't find programmer id "wiring"

Valid programmers are:
c2n232i = serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts [C:\all_apps\arduino-1.0.4\hardware/tools/avr/etc/avrdude.conf:876]
dasa3 = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [C:\all_apps\arduino-1.0.4\hardware/tools/avr/etc/avrdude.conf:863]

(plus a long list of more valid programmers)

I then tried improvising, and copied over the original version of avrdude.conf (as downloaded with version 1.0.4). This too compiled ok, and claimed to download, but then produced the error…

error at C:\all_apps\arduino-1.0.4\hardware/tools/avr/etc/avrdude.conf:332 unrecognized character: "w"

I found some other posts suggesting that the error might be related to the addition of the ‘—relaxer’ flag when Arduino was upgraded to 1.0.1, but couldn’t actually find a proposed fix or workaround.

Ok, finally got it work. I regressed to version 1.0 and the code compiled, uploaded and ran!

it looks like the post about the possible side effects of the --relaxer flag being added from version 1.0.1 onwards was correct.

So, is the --relaxer option user-configurable? Can I run version later versions and disable this, or am I forever stuck at version 1.0?

Thanks

BigusDickus:

avrdude: Can't find programmer id "wiring"

Valid programmers are:
c2n232i = serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts [C:\all_apps\arduino-1.0.4\hardware/tools/avr/etc/avrdude.conf:876]
dasa3 = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [C:\all_apps\arduino-1.0.4\hardware/tools/avr/etc/avrdude.conf:863]

I think it would be worth comparing the two versions of avrdude.conf. The symptoms suggest that the Arduino conf file has entries which are not in the standard one, and that the old Arduino one is not compatible with the new version of avrdude. Perhaps if you can locate the "wiring" entry that is used by Arduino, and see how that compares to the other entries in the new .conf file, you could figure out how to make a "wiring" entry that works with the new avrdude.

I think it would be worth comparing the two versions of avrdude.conf

I've tried playing with the file, but there the changes seem to be non-trivial. The number of errors seem to go up rather than down as I edit!

It may be taking you off at a tangent, but perhaps you could locate the standard conf file for avrdude at the version your current Arduino IDE is based on and see what was changed for Arduino? Hopefully it is only a localised change. That might give you a chance of figuring out how to make an equivalent change to the new version of avrdude's conf.

I must admit this is starting to feel like a red herring given how indirectly it relates to the original error.