Go Down

Topic: Ethernet problem Mega vs UNO on Raspberry Pi (Read 1 time) previous topic - next topic


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?

Scott H

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?

Scott H

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.

For now it is a Debian only bug, but if Arduino moves to gcc 4.7 they will have to handle it. Debian is working on it here:

[1] http://code.google.com/p/arduino/issues/detail?id=729
[2] http://sourceware.org/bugzilla/show_bug.cgi?id=13612


Thanks for the prompt reaction, Scott.

for the record, my Pi is running Raspian Wheezy.

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.

I will keep watch for further updates.

Scott H

Aug 30, 2012, 06:58 pm Last Edit: Aug 30, 2012, 07:04 pm by Scott H Reason: 1
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)

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:

and may take a couple of days. You can "apt-get upgrade" once it hits the repo there as well.


It appears that this could be marked as solved once the Arduino staff can respond with the build of the updated binutils-avr 2.20.1-3.

Will staff be able to notify this forum when that happens?



binutils-avr 2.20.1-3 is now in the raspbian repository, please install and test it.


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.
Ethernet.cpp  passing IPAdress data requires this change(in bold):
IPAddress gateway, IPAddress subnet)
  _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?

Can these problems be fixed?


RaspberryPi/Raspbian has made recent (8/29 - 8/31/12) updates to its installation. These are sudo apt-get upgrade to their 08-16 download.

the SdFatLib library has also been updated.

Arduino's 1.0.1 linux/ARM installation has also been updated.

At any rate, I'm able to successfully install Arduino1.0.1 on the Raspberry, and compile and upload to my Mega2560.

I feel that these issues have been resolved

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131