Go Down

Topic: Arduino 1.6.9 for Odroid C2 (Arm64) (Read 7468 times) previous topic - next topic

KurtE

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.

Code: [Select]
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:

Code: [Select]
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?

jackSilb

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

KurtE

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

I Probably need to post on the Developers email list.

jackSilb

 :(

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

KurtE

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.

jackSilb

#5
Jun 30, 2016, 02:57 am Last Edit: Jun 30, 2016, 03:38 am by jackSilb
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

KurtE

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.

KurtE

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


jackSilb

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


KurtE

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.

jackSilb

> 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? ;-)


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


KurtE

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.

KurtE

#12
Aug 03, 2016, 04:33 pm Last Edit: Aug 07, 2016, 03:01 pm by KurtE
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:
Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
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:
Quote
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
Quote
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.

http://forum.pine64.org/showthread.php?tid=1753

Pete

jackSilb

Nice  :) 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

jackSilb

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

Go Up