Cross-Compile: Configure QtCreator for Intel Edison

A few months ago a new friend gave to me an Intel Edison board to play =)

IMG_20160813_180658

When I got back home I mounted the board and start to configure. Download from Intel the environment necessary to programming using Node.Js and others frameworks.

Since the Intel XDK environment is too heavy, and I like to use QtCreator, I will configure the Cross-Compile environment to use QtCreator like my editor. I will try in the future write Qt Applications and run them on the Edison, but that is a subject for an another post.

So in the Intel Forum, I found a tutorial in how to build the cross-platform environment for QtCreator on your machine to build apps for the board. Is a tutorial from 2015, but I will replicate in my way. =)

For this tutorial I assuming that you know what is: QtCreator, CMake, GDB, and ssh access.

#1

You need to download the Cross Compiling tool from the Intel site, you can find the list of operational systems and the right SDK  Tools here.

Screenshot_20160813_181541

#2

Extract the files in your personal folder. And execute the script to install the libraries.

#2 Fail

Screenshot_20160813_182250

This is the same error that I found when I was trying to install the package of Intel Edison board in Arduino IDE. Is a parameter that isn’t written like +111 anymore. You need to open the script file and change it to /111.

Screenshot_20160813_183448

After that run the script again: sudo ./install_script.sh

I didn’t execute the script in sudo mode. And that made all the installation in my local folder. That would be a problem if I delete the folder for example.

Even running the script in sudo mode, didn’t installed the files in the right folders. Apparently don’t have any settings to install in /opt/poky-Edison.

After one hour testing, me and a friend of mine conclude that the install script is awful. It has an environment variable to the default folder:

DEFAULT_INSTALL_DIR=/opt/poky-edison/1.6.1

And the target dir is empty: target_sdk_dir=””

In the line 61 it sets: target_sdk_dir=$(pwd)

To run some commands that use others files in the i686 folders. So if I change, to the DEFAULT_INSTALL_DIR, it brokes and the scripts end with an error.

In any other place in the script, have an attribution of the DEFAULT_INSTALL_DIR in the target_sdk_dir.

I don’t have much knowledge with Shell Script to fix the install script. So I will leave like that and hope that I don’t delete this folder for some reason.

If you want to check the script click here.

#3

Now you need to open QtCreator. After that go in Tools -> Options -> Devices

Screenshot_20160813_200903

Click Add… to add a new device. Select the option of a New Generic Linux Device:

Screenshot_20160813_201009

After that configure you need to configure the access for your Edison:

Screenshot_20160813_202228

Click to finish the Wizard, and QtCreator will try to open an ssh connection to your Edison. If return Success, you are set up, else you need to discover the issue and solve it. =)

Screenshot_20160813_212048

#4

Now you need to add a new Kit in QtCreator, this Kit will lead to you to compile the source code to your Intel Edison.

Go to Tools -> Options -> Build and Run

Open the Tab Compilers.

You need to add a new GCC compiler for the Intel Edison device, so you need to search where on your system the file: i685-poky-linux-g++

In my case is here: “/home/lays/Downloads/i686/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux/i685-poky-linux-g++”

Screenshot_20160813_204452

Now you need to set up the Kit, go to the tab Kits, and click to add a new Kit.

Screenshot_20160813_214443.png

Set the Sysroot path to:

Screenshot_20160813_210132

Important #1!

On the Device Type you will choose the Generic Linux Device, and on the Device option bellow should appear your Edison automatically.

Important #2!

You need to setup the Cmake Tool because is the tool that will manage the Cross Compile and the project.

Important #3!

Select the Qt version for None.

Well, click Ok and now you finish your setup of your Kit for the Edison board.

#5

Now we need to setup one CMake Configuration file to tell the Edison what’s need to be done. Were put the deploy files, what compile, flags to use, and so on.

You can name the file to Edison.cmake, this file can be general for any project that you want to do. But if you need something more specific you need to edit for your necessity.

You can access my version of the Edison.cmake here.

#6

Well, now you only need to create a new project, using a CMakeLists.txt to make the library and build control adding this flag:

#This is where all the settings to compile for the Edison are stored.

INCLUDE(${CMAKE_SOURCE_DIR}/Edison.cmake

Now you have all your environment for Cross Compile projects to your Intel Edison from your QtCreator.

If you need more info, you can access the base post here.

In the next post, I will make my test, and maybe include some Qt code and see what happens. But for now…

That’s all folks!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s