Arduino 1.6.9 for Odroid C2 (Arm64)

Since Arduino and Teensyduino(PJRC) now has a release of Arduino for Arm processors, I thought I would try it out on my different ODroid processors. It works fine on my Odroid C1+ as well as Xu4.

However it does not run on my Odroid C2 which is a 64 bit Arm processor currently running Ubuntu 16.04 (64 bit)

It downloads, but when I try to launch it, Java fails.

odroid@odroid64:~/arduino-1.6.9$ ./arduino
Picked up JAVA_TOOL_OPTIONS: 
=============== DEBUG MESSAGE: Atomic load(jlong) unsupported on this platform ================

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x00000006, pid=2359, tid=3795117168
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b132) (build 1.8.0-b132)
# Java VM: Java HotSpot(TM) Client VM (25.0-b70 mixed mode linux-arm )
# Problematic frame:
# C  0x00000006
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/odroid/arduino-1.6.9/hs_err_pid2359.log
./arduino: line 34:  2359 Segmentation fault      "$JAVA" "${JAVA_OPTIONS[@]}" processing.app.Base "$@"
odroid@odroid64:~/arduino-1.6.9$ ^C
odroid@odroid64:~/arduino-1.6.9$

I tried a suggestion from Paul of PJRC to remove the downloaded Java and run it with Java installed on Odroid and it also fails:

odroid@odroid64:~/arduino-1.6.9$ ./arduino
Picked up JAVA_TOOL_OPTIONS: 
=============== DEBUG MESSAGE: Atomic load(jlong) unsupported on this platform ================

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x00000006, pid=4268, tid=3788280944
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b132) (build 1.8.0-b132)
# Java VM: Java HotSpot(TM) Client VM (25.0-b70 mixed mode linux-arm )
# Problematic frame:
# C  0x00000006
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/odroid/arduino-1.6.9/hs_err_pid4268.log
./arduino: line 34:  4268 Segmentation fault      "$JAVA" "${JAVA_OPTIONS[@]}" processing.app.Base "$@"
odroid@odroid64:~/arduino-1.6.9$ mv java/ java_save
odroid@odroid64:~/arduino-1.6.9$ ./arduino
Picked up JAVA_TOOL_OPTIONS: 
java.lang.UnsatisfiedLinkError: /home/odroid/arduino-1.6.9/lib/liblistSerialsj.so: /home/odroid/arduino-1.6.9/lib/liblistSerialsj.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at processing.app.Platform.loadLib(Platform.java:155)
	at processing.app.Platform.<clinit>(Platform.java:150)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at processing.app.BaseNoGui.initPlatform(BaseNoGui.java:677)
	at processing.app.Base.guardedMain(Base.java:151)
	at processing.app.Base.main(Base.java:135)
/home/odroid/arduino-1.6.9/lib/liblistSerialsj.so: /home/odroid/arduino-1.6.9/lib/liblistSerialsj.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
Cannot load native library /home/odroid/arduino-1.6.9/lib/liblistSerialsj.so
The program has terminated!
odroid@odroid64:~/arduino-1.6.9$

For the fun of it, I have now downloaded the sources onto my C2 and tried doing a build. Unless I tell it it's platform it fails. ( ant clean dist -Dplatform=linuxarm )

Run also fails not finding platform.

Wonder if I should try hacking the build.xml file and maybe try to find everywhere that talks about linuxarm and add something like linuxarm64, which does the same, except set arch-bits to 64...

Other suggestions?

Hey,

Any progress on making Arduino 1.6.9 run on the Odroid C2 Ubuntu 16.04 64 bits?

The sudo apt-get install arduino install the usual old Arduino IDE linux.

1.6.9 Arm downloaded from the Arduino site (./install) is not working for some reason. No error, just don't launch.

Thanks,
-Jack

Sorry I have not gotten any farther with this. Been off doing other stuff.

I Probably need to post on the Developers email list.

:frowning:

I was hoping that someone in the Arduino community would reply.

I wonder if 1.6.9 was tested with Linux Arm 64 bits, more specifically Ubuntu. Any help will be appreciated.

These little boards are starting to pop-up in very affordable price. I am imaging that there will lots of applications for the pair of boards /technologies.

Thanks,
-Jack

Me too.

However I decided to try it again. So I updated my C2 to latest stuff:
sudo apt-get update/upgrade/dist-upgrade

Used remote desktop on windows to bring up the desktop. Tried running 1.6.9 again and it failed.

I then downloaded the linux arm nightly build, and this appears to run. So you might try that.

Probably won't help me completely as I mainly do Teensy stuff and the installer won't probably like this non-release.

It is not working for me.

I applied the update/upgrade/dist-upgrade

reboot

downloaded the Arduino nightly arm
Uncompressed the file

chmod +x install.sh
./install.sh

It installs

"Adding desktop shortcut, menu item and file associations for Arduino IDE... done"

I click over the Arduino Icon, nothing

I used the Applications/Programing/ArduinoIDE, nothing

Uninstalled ArduinoIDE

I installed the default AurduinoIDE
sudo apt-get install arduino , it works the usual ver 1.05

Then I repeated the ./install.sh

Same thing nothing.

Then trying ./arduino

odroid@odroid64:/opt/arduino-nightly$ ./arduino
./arduino: line 34: /opt/arduino-nightly/java/bin/java: No such file or directory

It does not seem to like the java.

odroid@odroid64:~$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
odroid@odroid64:~$

Thanks,
-Jack

let me double check.

This time around, yesterday when I did this, I did not install it, but instead had a command prompt,
where I cd to the directory I extracted the Arduino IDE into, and then did a ./arduino

Will verify again that I did not screw up and forgit the ./

If it still works, I will then maybe try install and see what happens then.

It appears to work still today, after again I did the full update stuff. It also appeared to run fine after I installed it.

Huh, that is interesting.

I appreciate you taking the time to help.

I am pretty sure we have the same hardware and software. We just have one C2 OS image going around (Ubuntu64) from the Odroid site, right?

I did not change anything from the install except putting a fix IP address and installing VNC server tight.

I will start fresh once I have access to a monitor, keyboard, and mouse again. I am on the road. I have my C2 with me just to play at night after work. I was hoping I would make it talk to an arduino board while in this trip.

Can you tell me the steps and command lines you used to install the Arduino 1.6.9?
If you used SSH, maybe just go to the terminal history cut and paste the commands in your reply.

I am assuming you did not install the default Arduino IDE before the 1.6.9 that is, > sudo apt-get install arduino

And did not messed around with any Java downgrade and or installs.

Were there dependences packages that you installed first? Lets say any 32 bits libraries that Arduino, actually Java may look for?

As expected the ./install.sh install only the icon and menu option. It will not install dependence packages.

Thank you again!,
-Jack

Warning: as I mentioned, 1.6.9 did not work for me. Instead I tried the nightly build.

In particular: I used firefox and browsed to: https://www.arduino.cc/en/Main/Software
I clicked on the hourly build for Linux Arm: which has the link: https://www.arduino.cc/download.php?f=/arduino-nightly-linuxarm.tar.xz

When the download completed, I clicked on the downloaded item, which brought up a linux gui app, I then told it to extract, which it created a new directory in my Downloads folder.

I opened up a command prompt (CTRL+ALT+T), and CDed into this new folder and first tried running it with
./arduino... which worked. I then tried the ./install.sh which created the desktop icon, which when double clicked also appeared to work.

Note: this is not a vigin install. Earlier I was experimenting with trying to uninstall java, reinstall java 32 bits...

So I maybe did something that helped make it work.

I believe the Arduino downloads are supposed to be self contained, that is they include their own copy of the Java system.

Note: this is not a vigin install. Earlier I was experimenting with
trying to uninstall java, reinstall java 32 bits...

Aha,

That is probably it.
Mind telling me how you installed the Java 32 bits? :wink:

Yes, I am trying the nightly built based on your recommendation. I should not have said 1.6.9 on my last post.
I hope this thread will eventually help others.

Thank you!
-Jack

I have now posted some of the later stuff here in this thread into the thread I created on the ODroid forum,
http://forum.odroid.com/viewtopic.php?f=136&t=21249

There may be more information there on what I tried earlier to install 32 bit support and/or more people up there who can give clues on how to do so. I am pretty rusty right now.

I thought I would update this one now, in case anyone else is looking. From my last posting up on Odroid forum:

Follow up:
For the fun of it I tried installing Arduino 1.6.10 on an Odroid C2 which I installed a fresh copy of Ubuntu 16.04 (ARM 64 bit), to see if the 32 bit arm version would run on it, as I was earlier able to get the daily Arduino to run on the board, but I had played around a lot so was not sure what was needed...

The problem is their ARM version is setup to run 32 bit java and other stuff, so it needs the 32 bit versions of the libraries it uses...
I was able to get the basic Arduino to run by adding:

sudo apt-get install libxtst6:armhf

Edit: Note: I earlier installed 32 bit firefox, which installed different things, so if the above still does not work you might also try installing the 32 bit firefox as well.

Next up Teensyduino 1.30 beta 2... I downloaded it and it would not run. Was able to get it to run by
adding:

sudo apt-get install libxft2:armhf

Started up Arduino, loaded blink, plugged T3.2 into C2 and clicked upload. The program compiled, but the Teensy loader failed to load. Tried in command line and the reboot also failed to load. Fixed by
adding:

sudo apt-get install libusb-0.1-4:armh

Still failed until I added the udev rules. But now my Teensy is blinking

Note: it sometimes fails to program and I need to hit program button...

Also information I received on the Arduino Developers mail list:

if your kernel has been compiled with

Userspace binary formats ---> Kernel support for 32-bit EL0

it should be able to run both ARM64 and ARM32 binaries. The problem here is that any library linked by those binaries must be 32bit (as it already happens with x86_64 and i686 compatibility libc and runtimes).

The IDE package is self contained only for ARM32 at the moment.

Best,
Martino

And

Well, I suspect that the 64bit part is the main issue you'll encounter, as 64 bit ARM is still a bit on the green side (read "nearly nonexistent" in some instances"..

You may find this thread on the Pine64 forum of some interest, as some guys there have been working on how to get the latest Arduino IDE working on the Pine64, which is another 64bit ARM SoC board.

Arduino IDE on Pine64

Pete

Nice :slight_smile: of you coming back. I know the feeling to have to know the answer and make something work.

On the road again. This time without my boards to play with.
Could not resist leaving you a thank you note.

Thank you in advance. I will test and report back once I get home.

-Jack

It worked!

Indeed I had to install Firefox 32 bits for some reason to make the Arduino IDE 1.6.10 launch. I am guessing it is the 32bits libraries discussion all along. There is something more the install of Firefox 32 bits enables.

For the folks trying this, when you install Firefox 32 bits on the OdroidC2 it takes a while on the first launch without any indication it is launching. It takes few minutes. I thought the Firefox install did not work. I started to play with the Arduino IDE when Firefox came alive.

Here is the command I used to install Firefox32 bits on the Ubuntu 64 bits V16.04 Arm running on Odroid C2

sudo apt-get remove firefox && sudo apt-get install firefox:armhf

I am gladly surprised how fast the Arduino IDE is compiling the simple Blink and uploading to a Mega Arduino.
Very cool. That will open some opportunities to play with ROS and Arduino.

THANK YOU!
-Jack

Glad it is working for you!

Thanks for the good posts.
Arduino IDE 1.6.10 is working.
But the Serieller Monitor is not working. what am I doing wrong.

André

I have not done much yet with the Arduino on C2 yet, other than get it working.

I tried with 1.6.11 with Teensyduino 1.20 beta 3 and there does appear to be some issues with the Serial monitor. In my case not sure if any differences between using straight Arduino or with added Teensyduino caused issues.

I do see there was an error in the command prompt where I launched Arduino from

Sketch uses 17,512 bytes (6%) of program storage space. Maximum is 262,144 bytes.
Global variables use 4,652 bytes (7%) of dynamic memory, leaving 60,884 bytes for local variables. Maximum is 65,536 bytes.
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class jssc.SerialNativeInterface
	at jssc.SerialPort.<init>(SerialPort.java:120)
	at processing.app.Serial.<init>(Serial.java:115)
	at processing.app.Serial.<init>(Serial.java:66)
	at processing.app.TeensyMonitor$4.<init>(TeensyMonitor.java:131)
	at processing.app.TeensyMonitor.open(TeensyMonitor.java:131)
	at processing.app.Editor.handleSerial(Editor.java:2651)
	at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:384)
	at java.awt.Component.processMouseEvent(Component.java:6532)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6300)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4891)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4713)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4522)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2750)
	at java.awt.Component.dispatchEvent(Component.java:4713)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Posted on Arduino developers email list as well as on Teensy forum. Will try to investigate more later.

But you might try launching Arduino from terminal window and see if you are getting similar messages

Hello,

the Arduino program comes at the start of the serial monitor this . Program the ESP8266 12E

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /home/odroid/.jssc/linux/libjSSC-2.8_armsf.so: /home/odroid/.jssc/linux/libjSSC-2.8_armsf.so: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at jssc.SerialNativeInterface.<clinit>(SerialNativeInterface.java:172)
    at jssc.SerialPort.<init>(SerialPort.java:120)
    at processing.app.Serial.<init>(Serial.java:113)
    at processing.app.Serial.<init>(Serial.java:66)
    at processing.app.SerialMonitor$3.<init>(SerialMonitor.java:93)
    at processing.app.SerialMonitor.open(SerialMonitor.java:93)
    at processing.app.Editor.handleSerial(Editor.java:2625)
    at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:384)
    at java.awt.Component.processMouseEvent(Component.java:6532)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6300)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4522)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

The file libjSSC-2.8_armsf.so is the correct folder.

Hey,

Actually, have not tested the serial monitor. I just change and compiled a sample blink code, ran it, and moved on.

I was spending the limited time I had on ROS running on Ubuntu16.04 to then talk to an Arduino board.
I will run some test when I get back close to my setup and let you know.

Thanks,
-Jack