Go Down

Topic: Solution to PCREL error for avr25/ATTiny84/ATTiny85/ATTiny88. (Read 14867 times) previous topic - next topic

fungus

Download WinAVR here, extract the files (it's a zip file)

http://sourceforge.net/projects/winavr/files/latest/download?source=files

a) Find the "bin" folder in the extracted files.

b) Find a similar looking folder in your Arduino installation.

Copy all files from (a) to (b).
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Tom Carpenter

#16
Feb 05, 2013, 09:50 am Last Edit: Feb 05, 2013, 09:53 am by Tom Carpenter Reason: 1
have you restarted the IDE?

Double check you put the ld file in this folder:
"<arduino directory>\hardware\tools\avr\avr\bin"

Did you extract the ZIP file?

Did you definitely get the Windows version (not the Mac version by accident)?



This fix definitely applies to your problem, and should work.



@fungus, you don't need the whole folder, just the ld file.
~Tom~

fungus


@fungus, you don't need the whole folder, just the ld file.


True, but why not have the latest compiler, etc., as well?

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

kculm


Download WinAVR here, extract the files (it's a zip file)

http://sourceforge.net/projects/winavr/files/latest/download?source=files

a) Find the "bin" folder in the extracted files.

b) Find a similar looking folder in your Arduino installation.

Copy all files from (a) to (b).



The only BIN folder I find in the Arduino-1.0.3 dir is in the java folder. is that it?

fungus


The only BIN folder I find in the Arduino-1.0.3 dir is in the java folder. is that it?


No. You want a folder with the same files in it as winavr's 'bin'.

Mine is: ./arduino-1.0.1/hardware/tools/avr/bin

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

kculm



The only BIN folder I find in the Arduino-1.0.3 dir is in the java folder. is that it?


No. You want a folder with the same files in it as winavr's 'bin'.

Mine is: ./arduino-1.0.1/hardware/tools/avr/bin




Yep, found it. I was looking in the wrong place. It looks like it works now. Thanks everyone's help.



septic

Thank you, thank you, thank you, Tom. The Id patch worked perfectly with Arduino 1.0.4 on Mac os X 10.6.8. Now I can program my attiny85!

Mario

icegooner

#24
Jul 29, 2013, 01:32 pm Last Edit: Jul 29, 2013, 01:39 pm by icegooner Reason: 1
Dear Tom

I'm having the same problems at everybody in this thread but your fix unfortunately hasn't helped. I'm using Arduino Uno and ATtiny85. Here's my error:

Code: [Select]
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: inf_mirror.cpp.elf section .text will not fit in region text
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: region text overflowed by 4440 bytes
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn85.o: In function `__vector_default':
(.vectors+0x8): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_4' defined in .text.__vector_4 section in core.a(wiring.c.o)
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn85.o:(.init9+0x0): relocation truncated to fit: R_AVR_13_PCREL against symbol `main' defined in .text.main section in core.a(main.cpp.o)
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn85.o:(.init9+0x2): relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o)
inf_mirror.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Program Files (x86)\Arduino/inf_mirror.ino:21: relocation truncated to fit: R_AVR_13_PCREL against symbol `Potentiometer::Potentiometer(unsigned char)' defined in .text._ZN13PotentiometerC1Eh section in Potentiometer\Potentiometer.cpp.o
C:\Program Files (x86)\Arduino/inf_mirror.ino:22: relocation truncated to fit: R_AVR_13_PCREL against symbol `Potentiometer::Potentiometer(unsigned char)' defined in .text._ZN13PotentiometerC1Eh section in Potentiometer\Potentiometer.cpp.o
inf_mirror.cpp.o: In function `AllOn()':
C:\Program Files (x86)\Arduino/inf_mirror.ino:1077: relocation truncated to fit: R_AVR_13_PCREL against symbol `digitalWrite' defined in .text.digitalWrite section in core.a(wiring_digital.c.o)
C:\Program Files (x86)\Arduino/inf_mirror.ino:1078: relocation truncated to fit: R_AVR_13_PCREL against symbol `shiftOut' defined in .text.shiftOut section in core.a(wiring_shift.c.o)
C:\Program Files (x86)\Arduino/inf_mirror.ino:1079: relocation truncated to fit: R_AVR_13_PCREL against symbol `shiftOut' defined in .text.shiftOut section in core.a(wiring_shift.c.o)
C:\Program Files (x86)\Arduino/inf_mirror.ino:1080: relocation truncated to fit: R_AVR_13_PCREL against symbol `digitalWrite' defined in .text.digitalWrite section in core.a(wiring_digital.c.o)
C:\Program Files (x86)\Arduino/inf_mirror.ino:1081: relocation truncated to fit: R_AVR_13_PCREL against symbol `delay' defined in .text.delay section in core.a(wiring.c.o)
inf_mirror.cpp.o: In function `Checker()':
C:\Program Files (x86)\Arduino/inf_mirror.ino:47: additional relocation overflows omitted from the output


Here's what I've done to try to fix it:

1. Followed every step in http://arduino.cc/forum/index.php/topic,60649.msg437771.html#msg437771 (I didn't have WinAVR previously so didn't have to replace anything, there was no tools folder)
2. Downloaded the patch and replaced the ld.exe file in the hardware/tools/avr/avr/bin folder with the one from the patch zip

I definitely got the Windows version, not the Mac one.
I have restarted the IDE.



Let me know if I should post anything else, like my code (really long and essentially irrelevant to this problem if I understand correctly) or boards.txt. Thanks a bunch!

icegooner

Does anybody have any tips for me? I'm making a birthday present for my little nephew for his party tomorrow and I'll be in quite a pickle if I can't get this sorted. Any help would be greatly appreciated!

Coding Badly

1. Followed every step in http://arduino.cc/forum/index.php/topic,60649.msg437771.html#msg437771 (I didn't have WinAVR previously so didn't have to replace anything, there was no tools folder)


If you don't have WinAVR installed, how could you follow every step?

Coding Badly


Navigate to this directory...
[font=Courier New]C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\bin\[/font]

Is there a file named[font=Courier New] ld.exe [/font]in that directory?

Is the file dated[font=Courier New] 12/04/2008 [/font]or[font=Courier New] 3/14/2009[/font]?

icegooner

#28
Jul 30, 2013, 02:37 am Last Edit: Jul 30, 2013, 02:41 am by icegooner Reason: 1
I just set up Arduino IDE and did everything again according to instructions on a new computer (and there was stuff different between this and the one from before, like when I installed Arduino IDE on the previous one there was no tools directory, but now there was). And the ld.exe file was dated 03/14/2009.

Anyway, I've done everything and things are looking up, but there still one error (related to ld.exe).

Code: [Select]
e:/arduino in/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: infmirror.cpp.elf section .text will not fit in region text
e:/arduino in/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: region text overflowed by 4440 bytes


I've replaced the old ld.exe (dated 12/04/2008) with the one from the patch (dated 3/14/2009) but now this is the only error I get. Any ideas? :)

EDIT: I've just discovered that now I'm just being dumb and I've exceded the ATtiny capacity... :P So I'm all good now, I'll just have to try to shorten the code before the big birthday tomorrow. Thanks a bunch Coding Badly!

Coding Badly


You are welcome.  I'm glad you are back on track.

Go Up