Problem uploading to MEGA 2560 with Raspberry Pi B

Hello!

I am running Raspbian Wheezy on my new Raspberry Pi Model B. I installed the Arduino IDE. I am able to upload the Blink sketch, using the Pi, to an Arduino Uno with no problem. However, when I connect a MEGA 2560 to the same USB cable instead, and change the Board selection under Tools to "Arduino Mega 2560 or Mega ADK", uploading the same sketch fails. Here are the errors provided:

/home/pi/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:91:41: error: attempt to use poisoned "SIG_USART0_RECV"
/home/pi/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:101:15: error: attempt to use poisoned "SIG_USART0_RECV"
/home/pi/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:132:15: error: attempt to use poisoned "SIG_USART1_RECV"
/home/pi/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:145:15: error: attempt to use poisoned "SIG_USART2_RECV"
/home/pi/arduino-1.0/hardware/arduino/cores/arduino/HardwareSerial.cpp:158:15: error: attempt to use poisoned "SIG_USART3_RECV"

I am able to upload sketches to this Mega board just fine if I use the IDE on my iMac.

Thanks so much for your help!

Claudia

Well, my only comment is, thats novel ! I have never seen that before, myself.

At least, you could work Ide Arduino on Raspberry Pi.
I couldn't make it work. I installed Arduino and when I connected Arduino Uno Board, I got this message:

Exception in thread "main" java.lang.ClassFormatError: Truncated class file
at sun.misc.FloatingDecimal.(FloatingDecimal.java:1870)
at java.lang.Double.toString(Double.java:196)
at java.lang.String.valueOf(String.java:2985)
at java.security.Provider.putId(Provider.java:433)
at java.security.Provider.(Provider.java:137)
at sun.security.jca.ProviderList$1.(ProviderList.java:71)
at sun.security.jca.ProviderList.(ProviderList.java:70)
at sun.security.jca.Providers.(Providers.java:56)
at sun.security.util.ManifestEntryVerifier.(ManifestEntryVerifier.java:47)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:331)
at java.util.jar.JarFile.getInputStream(JarFile.java:403)
at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:706)
at sun.misc.Resource.cachedInputStream(Resource.java:77)
at sun.misc.Resource.getByteBuffer(Resource.java:160)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:266)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)[/font][/color]

I fixed my problem, with the help of some info here: Arduino Forum

I couldn't for the life of me find the avr include files that I needed to look at, because I think the entire avr directory tree was installed as "hidden". Once I uncovered it - by default, the include files are under /usr/lib/avr/include/avr - I found the file io.h, which includes iom2560.h for the Mega2560. iom2560.h then includes the very obscure file iomxx0_1.h. In THAT file, I added the line

#define AVR_LIBC_DEPRECATED_ENABLE 1

near the bottom of the file, right before that flag is tested. If AVR_LIBC_DEPRECATED_ENABLE is not defined, then a long list of #pragma's are run to "poison" certain references, including the ones that were flagged as "poisoned" during the compile, causing fatal errors. The Blink sketch uploads and operates just fine now on the Mega....I may have caused myself new problems down the road, but for now, I'm happy, and can move on to bigger and better things!

oscarB, I suspect that your error listing is caused by X11 on your Pi either having crashed, or not ever started. The IDE needs X11 to be running on the Pi, or the IDE won't start. I am actually logging on to the Pi from my Mac, using a remote shell over my local network - I use the Terminal in Mac OS, and run the ssh command with a -X flag. The -X flag starts X11 on the Pi....you can also use other means to start X11 on the Pi directly, such as the "startx" command. Hope this helps....