iqbal0001 / arduino-tiny

Automatically exported from code.google.com/p/arduino-tiny
Other
0 stars 0 forks source link

I'm getting a compile error if my binary is > ~4.5KB for ATTiny84 #58

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Compiled a large program (with SoftwareSerial.h included).

Arduino IDE 1.01 with arduino-tiny v14 and ATTiny84 @ 8MHz (ATTiny85 fails too).

My compile error:

arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/av
r25/crttn84.o: In function `__vector_default':
(.vectors+0x16): relocation truncated to fit: R_AVR_13_PCREL against symbol 
`__vector_11' defined in .text.__vector_11 section in core.a(wiring.c.o)
arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/av
r25/crttn84.o:(.init9+0x2): relocation truncated to fit: R_AVR_13_PCREL against 
symbol `exit' defined in .fini9 section in 
arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/avr25\libgcc.a(_exit.o
)

Comment out a few random lines:

Binary sketch size: 4,246 bytes (of a 8,192 byte maximum)

Original issue reported on code.google.com by Vicki...@gmail.com on 15 Jul 2012 at 2:02

GoogleCodeExporter commented 8 years ago
Related to a bug in winavr. Solution: 
http://arduino.cc/forum/index.php/topic,60649.0.html

Original comment by robc...@gmail.com on 15 Jul 2012 at 9:11

GoogleCodeExporter commented 8 years ago

Original comment by arduino....@gmail.com on 30 Jul 2012 at 7:59

GoogleCodeExporter commented 8 years ago
I'm having this issue on OSX with Arduino IDE 1.0.1 with v15 and SVN HEAD  
versions of the cores, attiny84@1MHz.

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/
gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn84.o:(.init9+0x2): relocation 
truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 
section in 
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/
gcc/avr/4.3.2/avr25/libgcc.a(_exit.o)

and after commenting out a semirandom line: Binary sketch size: 4,204 bytes (of 
a 8,192 byte maximum)

Original comment by eero.afh...@gmail.com on 11 Oct 2012 at 8:00

GoogleCodeExporter commented 8 years ago
Does this help...
http://arduino.cc/forum/index.php?topic=116674.0

Original comment by arduino....@gmail.com on 11 Oct 2012 at 8:35

GoogleCodeExporter commented 8 years ago
It did, however the instructions are outdated, so new ones:

1. Download from http://www.obdev.at/products/crosspack/download.html 
AVRMacPack-20090319.dmg (newer versions might work, I did not test them...)
2. Mount the DMG and right-click on the installer, "show package contents"
3. Copy Archive.pax.gz to some tmp directory and unpack (I use unarchiver), I 
used ~/Downloads/foo as the directory
4. backup your Arduino linker: 

cp 
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin/ld 
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin/ld.
arduino

5. adjusting for the directory in step 3 copy the new linker in place:

cp ~/Downloads/foo/usr/local/AVRMacPack-20090319/./avr-4/bin/ld 
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin/ld

6. profit: Binary sketch size: Binary sketch size: 4,564 bytes (of a 8,192 byte 
maximum)

I don't have any really good ideas right now how to handle this automagically 
for the person installing the cores (it's getting kinda late).

Original comment by eero.afh...@gmail.com on 11 Oct 2012 at 9:31

GoogleCodeExporter commented 8 years ago
Thank you for the follow-up.

Original comment by arduino....@gmail.com on 16 Oct 2012 at 7:13

GoogleCodeExporter commented 8 years ago
I had the same issue on OS X with the Arduino IDE version 1.0.3.

I couldn't make it work with the previously referenced CrossPack version, and 
tried with a newer version, which fixed the bug.

The trick was that more recent versions of the CroosPack installer don't let 
the user browse its archive, and therefore it's not possible to copy the binary 
as explained in comment #5.

so here are some updated instructions:

1. Download most recent package from 
http://www.obdev.at/products/crosspack/download.html

2. Install it

4. backup your Arduino linker: 

cp 
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin/ld 
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin/ld.
arduino

5. copy the new linker in place:

cp /usr/local/CrossPack-AVR/avr/bin/ld 
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin/ld

if you installed more than one version of CrossPack, you might need to give the 
version in the path. For instance :

cp /usr/local/CrossPack-AVR-20121207/avr/bin/ld 
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/bin/ld

6. Restart the Arduino IDE

Worked for me on OS X 10.6

Original comment by kad...@gmail.com on 29 Jan 2013 at 8:28

GoogleCodeExporter commented 8 years ago
I can confirm this works. Arduino 1.0.5 on Mac OS X 10.8.3 here.
The Archive can in fact be unpacked, e.g. it is not necessary to install 
CrossPack as per above; simply send the download given in #7 to The Unarchiver 
(or any unzipper/untar'er), the send the file "Payload" to the same unarchiver 
twice more (you might have to rename the file to Payload.tar and Payload.zip in 
the process). You will end up with the usable (ie. for copying out of) file 
hierarchy.

Original comment by c...@radiopark.de on 28 May 2013 at 11:40