My work group is trying to set up a Raspberry Pi as a headless server to run Arduino IDE-1.0.1.
I have run thru and solved many bugs with the help of this forum and others.
Our program (sloppy as it is :~) ) will only operate in the Mega2560 (i.e. NOT the UNO)
It compiles when operated in a Win7, Arduino-1.0.1 system
At this point, our program will not compile.
We are loading the Arduino-1.0.1 into the Raspberry Pi via an apt-get install arduino command.
What we found is that WebServer example will 'verify' compile under a Uno Board select, but will not 'verify' compile when a Mega 2560/ADK is selected.
When the Mega board is selected, the resulting error from both our program and the WebServer example is:
collect2: error: ld terminated with signal 11 [Segmentation fault]
extensive searching on the web suggest that the problem is in the Pi's gcc file.
Has anyone been able to find a fix for this issue?
I think this is related to the newer version of avr binutils and gcc that Debian has. I'm asking around to see if anyone has an idea as to what is going on.
Have you tried downloading arduino from arduino.cc and confirm that it works?
ok, tracked it down - it's a bug in binutils. It's related to the fact that the mega 256 target board uses the -Wl,--relax linker option since it has greater than 128 kB of memory [1,2] which somehow started causing problems once code was compiled with gcc 4.7.
When I downloaded arduino-1.0.1-linux.tgz from arduino.cc to my Oracle VB Debian (on a Win7 box), WebServer compiled ok, as did my program. I did, as with the other 1.0.1 installs, have to update the SdFat library.
I have not attempted to download the Arduino.cc version to the Pi, and will try that today.
Looks like the bug reported has been fixed! I can compile the Ethernet library examples for a Mega 2560 or ADK on Debian Wheezy.
The problem was a bug in "ld" (binutils). It has been fixed. You need to download and install the brand new binutils-avr which is currently in unstable (version 2.20.1-3)
EDIT:
you are using Raspian, awesome. The official packages from arduino.cc therefore might not work for you (they are only good on intel/amd64 architectures). You'll have to wait until Raspian builds it. They will show up here: http://archive.raspbian.org/raspbian/pool/main/b/binutils-avr/
and may take a couple of days. You can "apt-get upgrade" once it hits the repo there as well.
It appears that this specific fix worked as intended (fixed Uno to Mega verify).
However, there is a greater problem with operating Arduino-1.0.1 in the RaspberryPi/linux/ARM6 world. My perception is that many external modules use and pass data between themselves andthe main program, and do not properly discriminate the variable names and variable types in light of overall system requirements.
1)
Ethernet.cpp passing IPAdress data requires this change(in bold):
IPAddress gateway, IPAddress subnet)
{
W5100.init();
W5100.setMACAddress(mac);
W5100.setIPAddress(local_ip._address**.a8**);
W5100.setGatewayIp(gateway._address**.a8**);
W5100.setSubnetMask(subnet._address**.a8**);
_dnsServerAddress = dns_server;
}
2)In SD folder files, the function __cxa_pure_virtual is errored at many levels resulting in Verify compile errors like this
core.a(new.cpp.o): In function __cxa_pure_virtual': /usr/share/arduino/hardware/arduino/cores/arduino/new.cpp:17: multiple definition of __cxa_pure_virtual'
SdFat/SdStream.cpp.o:/root/sketchbook/libraries/SdFat/SdStream.cpp:94: first defined here
/usr/lib/gcc/avr/4.7.0/../../../avr/bin/ld: Disabling relaxation: it will not work with multiple definitions
SdFat/SdFatUtil.cpp.o: In function SdFatUtil::SerialPrintln_P(char const*)': /root/sketchbook/libraries/SdFat/SdFatUtil.cpp:73: undefined reference to SdFatUtil::__brkval'
/root/sketchbook/libraries/SdFat/SdFatUtil.cpp:73: undefined reference to SdFatUtil::__brkval' /root/sketchbook/libraries/SdFat/SdFatUtil.cpp:73: undefined reference to SdFatUtil::__bss_end'
/root/sketchbook/libraries/SdFat/SdFatUtil.cpp:73: undefined reference to `SdFatUtil::__bss_end'
collect2: error: ld returned 1 exit status
This error type bounces between many pieces of code in the SdFatlib folder. See entries in the SdFatLib wiki issue 36.
Solving these issues seem to be outside the realm of problems in 'My Code' and require attention from SdFatLib and Arduino.cc staff.
Does Arduino-1.0.0 do the same?
Is it worth my time to install 1.0.0 on my raspberryPi?