2.3 Setting up the Workspace for C Projects

Objectives for this tutorial:

2.3.1 Create Library, Tutorial and Simulator Projects

Before you can start with C, some preconditions must be fulfilled:

After installation of eclipse and the eTrice plug in, your workspace should look like this:

PIC

Just the eTrice menu item is visible of the installed eTrice plugins.

Select the menu File->New->Other

PIC

Open the eTrice tab and select eTrice C Runtime

Press Next and Finish to install the Runtime into your workspace.

PIC

Do the same steps for eTrice C Modellib, eTrice C Tutorials and eTrice Trafficlight for Tutorials. To avoid temporary error markers you should keep the proposed order of installation. The resulting workspace should look like this:

PIC

2.3.2 Perform Setup Test

To check the correct setup of your workspace we run a little testproject contained in the tutorial project.

The tutorial models are available in the org.eclipse.etrice.tutorials.c project. All tutorials are ready to generate and run without any changes. To test the code generator and the workspace setup simply run gen_SetupTestC.launch as gen_SetupTestC:

PIC

The successful generation ends with Info: – finished code generation in the Console.

PIC

For each tutorial in the folder src-gen a sub folder is generated which contains the generated code. The file <...>_Runner.c contains the main function. To run the generated application you first have to compile the project (with the hammer symbol in the C/C++ Perspective).

PIC

If the compilitation does not succeed, make sure to clean and compile the projects org.eclipse.etrice.runtime.c and org.eclipse.etrice.modellib.c with the correct build configuration for your platform. Depending on the setup of your C compiler and CDT you might have to change the pre defined build configurations MinGWDebug or PosixDebug.

After the successful compilation you can run the application as Local C/C++ Application.

PIC

To stop the application type quit in the console window. If your Console contains the lines

******************  
*** Setup OK ***  
******************

your setup should be ok.

PIC

Now the workspace is set up and you can perform the tutorials or start with your work.