I ssh into my Raspbmc installation through my iPad (I don't have a keyboard). I was looking into developing for Arduino on the Pi, as I don't have my primary PC with me right now.
I installed PlatformIO on the Pi and wrote test code to flash LEDs which compiled, uploaded and worked fine on the Uno board.
I then added some Serial code to the Arduino sketch which again compiled and worked fine.
The problem occurred when I started using math.h
code (trigo mostly) in the sketch along with the serial code. math.h
and the Serial code work fine independent of each other, but the sketch fails to compile when I use both together.
I feel this is more suited on the Pi network rather than the Arduino network since its a gcc error.
I'm on a Model B board running Raspbmc Wheezy and the latest version of PlatformIO.
This is the output:
Processing autogen_uno environment:
Auto-detected UPLOAD_PORT: /dev/ttyACM0
avr-g++ -o .pioenvs/autogen_uno/firmware.elf -Os -Wl,--gc-sections -mmcu=atmega328p .pioenvs/autogen_uno/src/test.o -L.pioenvs/autogen_uno .pioenvs/autogen_uno/libFrameworkArduino.a -lm
/home/pi/.platformio/packages/toolchain-atmelavr/bin/../lib/gcc/avr/4.5.1/../../../../avr/lib/avr5/libm.a(fp_powsodd.o):../../../../../source/avr-libc-1.8.0/libm/fplib/fp_powsodd.S:59: relocation truncated to fit: R_AVR_13_PCREL against symbol `__mulsf3' defined in .text section in /home/pi/.platformio/packages/toolchain-atmelavr/bin/../lib/gcc/avr/4.5.1/avr5/libgcc.a(_mul_sf.o)
/home/pi/.platformio/packages/toolchain-atmelavr/bin/../lib/gcc/avr/4.5.1/../../../../avr/lib/avr5/libm.a(fp_powsodd.o):../../../../../source/avr-libc-1.8.0/libm/fplib/fp_powsodd.S:69: relocation truncated to fit: R_AVR_13_PCREL against symbol `__mulsf3' defined in .text section in /home/pi/.platformio/packages/toolchain-atmelavr/bin/../lib/gcc/avr/4.5.1/avr5/libgcc.a(_mul_sf.o)
collect2: ld returned 1 exit status
scons: *** [.pioenvs/autogen_uno/firmware.elf] Error 1
Apparently, gcc is invoked with the following command:
avr-g++ -o .pioenvs/autogen_uno/firmware.elf -Os -Wl,--gc-sections -mmcu=atmega328p .pioenvs/autogen_uno/src/test.o -L.pioenvs/autogen_uno .pioenvs/autogen_uno/libFrameworkArduino.a -lm
-Wl,--gc-sections
. – goldilocks♦ Jan 26 '15 at 14:30