Problem uploading to MEGA 2560 with Raspberry Pi B


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!


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.(
at java.lang.Double.toString(
at java.lang.String.valueOf(
at java.util.jar.JarFile.initializeVerifier(
at java.util.jar.JarFile.getInputStream(
at sun.misc.URLClassPath$JarLoader$2.getInputStream(
at sun.misc.Resource.cachedInputStream(
at sun.misc.Resource.getByteBuffer(
at Method)

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


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 can also use other means to start X11 on the Pi directly, such as the "startx" command. Hope this helps....