Pages: 1 [2] 3   Go Down
Author Topic: Solution to PCREL error for avr25/ATTiny84/ATTiny85/ATTiny88.  (Read 8736 times)
0 Members and 1 Guest are viewing this topic.
Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4548
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

No, I don't answer questions sent in private messages...

Leeds, UK
Offline Offline
Edison Member
*
Karma: 71
Posts: 1641
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 05, 2013, 03:53:40 am by Tom Carpenter » Logged

~Tom~

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4548
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Logged

No, I don't answer questions sent in private messages...

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4548
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

No, I don't answer questions sent in private messages...

Offline Offline
Full Member
***
Karma: 1
Posts: 209
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Worked for me.
Thank you very much.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cheers Tom. A nice quick fix!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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!
« Last Edit: July 29, 2013, 06:39:10 am by icegooner » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Navigate to this directory...
C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\bin\

Is there a file named ld.exe in that directory?

Is the file dated 12/04/2008 or 3/14/2009?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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? smiley

EDIT: I've just discovered that now I'm just being dumb and I've exceded the ATtiny capacity... smiley-razz 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!
« Last Edit: July 29, 2013, 07:41:30 pm by icegooner » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Pages: 1 [2] 3   Go Up
Jump to: