Eclipse CDT C C++ KL05Z

The objective of this guide is to provide a walkthrough for installing and configuring an environment for developing ARM firmware on a computer running an Ubuntu system.

This isn’t going to be a guide for using eclipse or even write your first program with it. We have written dedicated guides that covers just that.

This guide will get you to download Eclipse IDE along with the ARM gnu compiler and any other plugin which together will give the means to write and compile your code. We will also be installing an eclipse plugin which will extend Eclipse functionality for a better support of embedded devices.

If you are planning on debugging you code on hardware, then you are going to need a debugger and OpenOCD. OpenOCD will allow you to step through you code and see what’s happing to your code on eclipse. I would suggest first installing OpenOCD before you attempt to install eclipse.
Here are two links to guides we’ve writing on install OpenOCD. If you are planning on using Freescale Kinetis boards debugger, then you will need follow the first link otherwise you can follow the second.

Key Notes and Assumptions

Throughout this guide we will be using colour boxes to highlight terminal command and notes. This will make it easier for us to highlight useful information.

The following are the colour boxes keys:

Linux Terminal Commands
Interesting Notes
Warning Notes

Assumptions

Install ARM GNU Compiler

To start, download the lasted version of the GNU compiler for this link.

Move the download to your desktop.
Compiler

Run this command on your terminal to install the 32bit libraries.

sudo apt-get -y install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32ncurses5

Move the terminal to the desktop directory.

cd ~/

Extract the download. Make sure that you replace gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 with your version.

tar -xjvf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2

Move the compiler files to the user local directory. Make sure that you replace gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 with your version.

sudo mv gcc-arm-none-eabi-4_9-2015q3 /usr/local/gcc-arm-none-eabi-4_9-2015q3
This is where user programs are generally installed. This is also where eclipse’s plugins are going to automatically look when trying to find a suitable compiler for the project.

we can go ahead and delete the original download file.

sudo rm gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2

The compiler is ready for use but unless you are planning on doing bare metal programing let go to the next section and install Eclipse.

Install Eclipse

Follow this link to download Eclipse. Make sure that select the Eclipse IDE for C/C++ Developers the Linux edition.

Luna Eclipse 64bit Download Page
Stick the download in your desktop. This will make it a little easier for the next few steps.
Luna Eclipse 64bit Ubuntu Descktop

Open up a terminal and change the directory to your desktop.

cd ~/Desktop

Now run this command to unpack eclipse. Replace the eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz with your downloads name.

tar -zxvf eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz

Now will move the eclipse directory to your user home directory.

mv eclipse ~/eclipse

Luna Eclipse 64bit Ubuntu - Home Directory

Delete the original download. Replace the eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz with your downloads name.

sudo rm eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz

Now will need to add the eclipse directory to our system path.

nano ~/.profile

Editing system PATH variable

At the bottom of .profile, add the following line.

PATH="$HOME/eclipse:$PATH"

It should look like this.
Eclipse Path profile

To save the file, press Ctrl+X then Press Y and finally to accept and exit the editor press Enter.

In order order to reload the system PATH variable, you will need to logout and back in of your user account. Then you should be able to see the new path in the system PATH variable when you run this echo command.

echo $PATH

Eclipse Path echo

Now we need to install java jdk.

sudo apt-get install openjdk-7-jdk

Installing GNU ARM Eclipse plugin

In order to make eclipse have better support for embedded firmware development, we need to install a hand full of plugins. These plugins adds project template, project wizard creator, support for openOCD and CMSIS register viewer. The good news is that all this plugin are actually made and maintain by the same guy.

Here is the link the project.

Start my opening eclipse. You can either use ubuntu search or you can just run this terminal command.

eclipse &

If Eclipse ask you to select a workspace Click OK.
Eclipse Workspace

Now in Eclipse, Click on the Help and then Install New Software.

Eclipse - Click Help then Install new software

On the new window, click on the Add button.
Eclipse - Click Add

On the Add Repository window, set Name to GNU ARM Eclipse Plug-ins
and Location to https://gnuarmeclipse.sourceforge.net/updates

Eclipse - Add Repository

Click OK.
Eclipse - Install with new Plugin

Now Tick GNU ARM C/C++ Cross Development Tools Option and click Next.
Eclipse - Install with new Plugin Option

Next Again.
Eclipse - Install with new Plugin Option Next

Accept the terms and Click on Finish.
Eclipse - Install with new Plugin Option Accept and Finish

If you get this security warning message. Go ahead and click OK.
Eclipse - Install with new Plugin Warning

You will need to restart eclipse in order the new plugin to take affect.

Eclipse is now ready for you to create your first project. Have Fun.

Are you looking for help?

If you are having issues with your project or are looking for some advice to get your next project started then feel free to contact us. We can provide a bespoke services that suite your needs.

Alternatively, if you are new to electronics and are interesting in learning more about developing your own embedded software and hardware then Contextual electronics is the perfect place to go to. its a pay service that I am part of that provides an apprenticeship style of teaching. You can work at your own pace and have access to any of the instructors for help you may need for your projects.

Comment(2). Leave comment

  • Pingback: #Define Electronics | Electronic and Mechanical Design | Proof of Concept | Turnkey Solutions | ATEX Compliance | Leeds | Mechatronic | Freelance | Ronald Sousa | Hash Define Electronics Ltd | limtied

  • Good article. I definitely love this website. Continue the good work!

    Leave a comment.

    Please note that all comments are moderated by a person and so it may take some time for it to show on the site. if you have an urgent issue then please feel free send us a message via our contact form below.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Get in touch.

    Whether you have an existing project that you need help with or if you want us to take care of the whole design process, we are happy to talk to you about your project and see if we can help. At the very least we should be able to point you in the right direction.

    Comments or questions are welcome.