Eclipse Desktop IDE for Linux
This article helps you set up an Eclipse development and cross-compilation environment on a Linux-based PC. The procedure has been tested on the Ubuntu 14.04 64-bit OS.
The procedures described here are mostly performed on your development PC, in order to create a binary file that you can copy to and run on your target ARTIK board.
The following steps need to be performed on the development PC to install the required dependencies.
Install the basic package set as follows.
sudo apt-get install git rsync build-essential
A Java JDK 8 is required for latest version of Eclipse. From Ubuntu 14.10 onwards it can be installed as follows:
sudo apt-get install openjdk-8-jdk
For older versions, do:
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer
GCC cross-compile toolchain
Many cross-compilation toolchains may be used to compile for the ARTIK platforms. This guide will use a specific one that has been tested to work well.
Download and install the toolchain to your development PC as follows..
Go to this Linaro Releases site:
Download the latest release in
x86_64_armformat. As of this writing, it is:
Make a directory on your PC.
sudo mkdir -p /opt/toolchains
Extract the files into the directory (using the filename you downloaded earlier).
sudo tar xvf gcc-linaro-5.4.1-2017.01-x86_64_arm-linux-gnueabihf.tar.xz -C /opt/toolchains
Go to http://www.eclipse.org/downloads/ and select the Eclipse Neon download for Linux (eclipse-inst-linux64.tar.gz).
tar xvf ~/Downloads/eclipse-inst-linux64.tar.gz
Follow the installation steps as described below.
Select the indicated installation package.
Select the Installation folder where you want to put Eclipse. Here we'll choose /home/user/eclipse and will later refer to it as such.
Follow the installation steps from the installer until the installation succeeds.
When it is done, it should automatically launch Eclipse. You can later launch Eclipse by typing the command:
When Eclipse asks for a workspace directory, name it as
You are now ready to create a project under Linux for ARTIK modules.
Create “Hello World” Project
Create a new project.
Specify Project name, Project type, and select Toolchains as shown below, then click Next.
Specify author name and click Next.
Accept the default configurations and click Next.
Specify the cross compiler prefix and path as shown and click Finish.
Build the application. Right-click on the application project and select “Build Project” to build the hello world executable.
The resulting binary file can be found at the Debug directory of the project workspace. For example:
Deploy to Target ARTIK Device
Connect your ARTIK board as usual through a terminal emulator as described here. You will need to be Wi-Fi®-connected as described in the Configuring Wi-Fi article. Your development PC and ARTIK board will need to be connected to the same network in order to copy over and run your programs using
scp (secure copy) as noted here.
To prepare for copying, change directories to the binary file location noted above.
Now enter the
scp command line. For example:
$ scp hello_world email@example.com:./.
The follow-on article will discuss a more convenient method for moving the files to the ARTIK board.
Run the Program
In your terminal emulator window, run
ls -l to make sure the file is where you expect it to be. Then change the file permissions to make it executable:
# `chmod 755 hello_world
Now you can finally run it! The terminal output should look like this.
[root@localhost ~]# ./hello_world Hello ARM World! [root@localhost ~]#
Spend some time adding and changing code to get familiar with the IDE operation.
Bringing in Libraries
Having given the IDE a test run, let's look into building applications using the ARTIK SDK and other open-source libraries available on ARTIK modules. Proceed now to the Eclipse and ARTIK SDK article, which will guide you through this process using ARTIK SDK example projects as a reference.