Tutorial: Installing ERIKA and RT-Druid on a Linux host

From ErikaWiki

Revision as of 15:28, 2 February 2011 by Nicola (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

This small tutorial describes the steps needed to download, compile and run a simple application showing the main features of Erika Enterprise and RT-Druid for the Microchip dsPIC DSC platform.

This tutorial has been tested on a FLEX board produced by Evidence and Embedded Solutions. Moreover, the needed software has been installed and tested on an Ubuntu 11.04 Natty Narwhal but the installation process should be adapted to almost all the other releases.

Even if all the steps needed to run an application will be depicted, a preliminary knowledge on the Microchip MPLAB X IDE and its debug environment should be useful to the reader.

Note for Linux Users

If you are using a Linux distribution please look carefully at the following warnings:

  1. The Evidence package installation path should NOT contain directory name with spaces. e.g. use ~/Evidence.
  2. The Scilab package installation path should NOT contain directory name with spaces: e.g. use ~/Evidence/scicoslab-4.4b7.
  3. It is strongly encouraged the adoption of the real path instead of using symbolic links and aliases.
  4. Please install all the Microchip compilers into their default directory (/opt/XXXX).

Prerequisites

Before proceeding with the installation process it should be useful to completely update the packages installed in you system to the latest version. To update all the packages open a Terminal window and execute the following commands:

sudo apt-get update
sudo apt-get upgrade

To execute the MPLAB X IDE a 32bit JRE have to be installed. Before to proceed with the JRE installation you need to check the multiverse repository enabled. You can perform this step from the Ubuntu Software Center and select "Edit -> Software Sources...", after inserting you password you must check the "Software restricetd by copiright or legal issues (multiverse)" option; otherwise you can enable this repository by editing the source.list, to do that in a Terminal window execute:

sudo gedit /etc/apt/sources.list

Then on the gedit window uncomment the line:

deb http://archive.canonical.com/ubuntu maverick partner

by removing the "#" character, then save the file and close gedit.


Finally to install the JRE on a Terminal window insert:

sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

Please notice that by installing a 64bit JRE RT-Druid will not work properly.

Installing MPLAB X IDE

To download the the MPLAB X IDE in a Terminal window execute:

cd ~

mkdir mplab_temp
cd mplab_temp

wget http://ww1.microchip.com/downloads/mplab/X_Beta/mplabxidebeta32.bin
wget http://ww1.microchip.com/downloads/mplab/X_Beta/mplabc18.bin
wget http://ww1.microchip.com/downloads/mplab/X_Beta/mplabc30.bin
wget http://ww1.microchip.com/downloads/mplab/X_Beta/mplabc32.bin

chmod a+x *.bin

sudo ./mplabxidebeta32.bin
sudo ./mplabc32.bin
sudo ./mplabc30.bin
sudo ./mplabc18.bin

Please notice that this step can require few minutes depending on the downloading speed.
You can speedup this process by downloading and installing only the compiles needed by your platform. Please remember to reboot you system after the installation of the last compiler.


At the end of the installation process either the directory and the bin files can be removed:

cd ~
rm -r mplab_temp


To enable the correct execution of the MPLAB X IDE you must set the owner of the MPLAB X IDE you have to assign the correct owner to the Desktop shortcut. In a Terminal window insert:

sudo chown user:user ~/Desktop/MPLAB\ X\ IDE\ beta4.desktop

please notice that "user" must be substitued with your username on the Linux host. Moreover, the location of the file depends on the language of your installed OS, e.g. for italian people the file could be located on ~/Scrivania/MPLAB\ X\ IDE\ beta4.desktop.


Moreover, to enable MPLAB X IDE to connect with the supported programmers you must set the execution flag to the file dorun.sh

sudo chmod +x /opt/microchip/mplab_ide/ide/bin/nativeexecution/dorun.sh


For furter information on MPLAB X IDE and its supported programmers please visit
http://ww1.microchip.com/downloads/mplab/X_Beta
and/or download
http://ww1.microchip.com/downloads/mplab/X_Beta/Getting_Started_with_MPLAB-X.pdf

Installing ERIKA Enterprise and RT-Druid on Linux

To download RT-Druid you can select the correct file from the webpage:
http://erika.tuxfamily.org/erika-for-multiple-devices/betaversionerikaenterprisertdruid160.html
or simply insert in a Terminal window

cd ~
mkdir eclipse_temp
cd eclipse_temp

wget http://download.tuxfamily.org/erika/webdownload/rtdruid_eclipse37/eclipse_3_7_ready_to_use_LINUX.zip
unzip eclipse_3_7_ready_to_use_LINUX.zip
mkdir ../Evidence/
mv eclipse ../Evidence

Please notice that the download process can require few minutes depending on the downloading speed.

You can now remove the downloaded file by

cd ~
rm -r eclipse_temp

To enable a desktop shortcut to the ~/Evidence/eclipse/eclipse file you can insert in a Terminal window

ln -s ~/Evidence/eclipse/eclipse eclipse

First RT-Druid startup and configuration

By opening Eclipse you will be prompted with a window asking for the directory containing your workspace.

File:RT-druid.1.6.0.workspace.png
This screenshot shows how to select the workspace directory.

It should be noticed that instead of "user" your username on the linux box will be displayed. You can simply click on "Ok" and the directory "workspace" will be created in your home.


After rew seconds you will be prompted with a "Welcome" screen

This screenshot shows the Eclipse welcome window.


To enable the updates of RT-Druid and its related distribution of Erika Enterprise select "Help -> Install New Software"

This screenshot shows how to select the "New Install Software".

In the "Install" window

This screenshot shows the Eclipse "Install" window.

select add and enter a reference name for the file repository (e.g. RT-Druid) and the link
http://download.tuxfamily.org/erika/webdownload/rtdruid_beta

This screenshot shows the Eclipse "Add Repository" window with the correct parameters.

by selecting "Ok" you will be prompted with a new screen. You have to select all RT-Druid sources. To speedup the update process you can unselect the option "Contact all site during install to find required software".

This screenshot shows the Eclipse "Install" window with the correct parameters.

Along the update process you may be prompted for a "Security Warning" simply click on "Ok" to continue with the process. Finally please restart Eclipse when asked by the installer.


Before to be able to compile you first application you have to select the correct compiler path. As this tutorial is devoted to enable programming a Flex Demo application, the correct compiler for C24 and dsPIC must be selected. Select "Window -> Preferences"

This screenshot shows where find the preferences menu.

On the "preference" window you have to select "RT-Druid -> Oil -> dsPIC" and then insert the path of the C and ASM compilers (/opt/microchip/mplabc30/v3.24/)

This screenshot shows how to select the PIC24, PIC30 and dsPIC compiler.

You can now close the "Welcome" screen by selecting "Workbench" icon

This screenshot shows how close the "Welcome" screen.
then to remove the autobuild you can uncheck "Project -> Build Automatically"
This screenshot shows how to disable the auto build option.

Create and Compiling your first ERIKA Enterprise demo

By opening Eclipse you will be now prompted with an empty screen

This screenshot shows an Ecplise empty screen.

to create your fist project select "File -> New -> Rt-Druid Oil and C/C++ Project"

This screenshot shows how to open the "C Project" window.

then on the "C Project" window, insert the name of you project, e.g. my_first_project.

This screenshot shows how to assign the project name.

then click on "Next". After checking "Create a project using one of these template", select "pic30-> FLEX Demo Board -> OO examples -> Task Demo" and click on "Finish".

This screenshot shows how to select a project template.


You will now be prompted with a screen containing all the existing project in the workspace

This screenshot shows a new template based project.

To build the project you can right-click on the project name and select "Build Project" from the context menu

This screenshot shows hot to build a project.

at the end of the building process Eclipse will signal the creation of the executable file and on the left panel a "Debug" subfolder contining all the files generated will be prompted

File:RT-druid.1.6.0-newproject.06.png
This screenshot shows the results of a correct building process.

Running your first ERIKA Enterprise demo

In progess

How to use ERIKA sources from svn

In progress

Personal tools