Difference between revisions of "Quick start guide"

From ERIKA WIKI
Jump to: navigation, search
(Building a project)
(Per Architecture tutorials)
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
= Prerequisites =
 
= Prerequisites =
 
The following is the list of software that should be already be installed in your system before installing ERIKA v3:
 
The following is the list of software that should be already be installed in your system before installing ERIKA v3:
* [[Java]]
+
* [[Java|Java (link)]]
 
** for running Eclipse
 
** for running Eclipse
* [[Cygwin]]
+
* [[Cygwin|Cygwin (link)]]
 
** for the GNU make tool (and optionally Doxygen)
 
** for the GNU make tool (and optionally Doxygen)
* [[Doxygen]]
+
* [[Doxygen|Doxygen (link)]]
 
** for the automatic documentation
 
** for the automatic documentation
* target compiler (depending on the architecture)
+
* target compiler
** [[Arduino_SDK|Arduino SDK]]
+
*: (additional information depending on the architecture; this is not a list of all supported compilers!)
 +
** [[Arduino_SDK|Arduino SDK (link)]]
 +
** [https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update ARM GCC Compiler] (for all Cortex-M derivatives)
  
 
= Downloading ERIKA v3 and RT-Druid =
 
= Downloading ERIKA v3 and RT-Druid =
 
* RT-Druid can be downloaded using the [http://www.erika-enterprise.com/index.php/download/erika-v3-download.html download web page]
 
* RT-Druid can be downloaded using the [http://www.erika-enterprise.com/index.php/download/erika-v3-download.html download web page]
 
* To download RT-Druid, you have to accept [http://www.erika-enterprise.com/index.php/erika3/licensing.html the RT-Druid and the ERIKA v3 licenses]
 
* To download RT-Druid, you have to accept [http://www.erika-enterprise.com/index.php/erika3/licensing.html the RT-Druid and the ERIKA v3 licenses]
** The ERIKA v3 license is a GPL v2, whereas the RT-druid license is a proprietary license that allows you to use the provided version of RT-Druid at no cost
+
** The ERIKA v3 license is a GPL v2, whereas the RT-Druid license is a proprietary license that allows you to use the provided version of RT-Druid at no cost
 
* [[Release_schedule_and_build_numbers|Here]] is possible to find more details about the release scheduling and ''build numbers'' of RT-Druid packaging.
 
* [[Release_schedule_and_build_numbers|Here]] is possible to find more details about the release scheduling and ''build numbers'' of RT-Druid packaging.
  
Line 21: Line 23:
 
= Starting RT-Druid =
 
= Starting RT-Druid =
  
* Double-Click on '''eclipse.exe''' application located into ''eclipse'' folder extracted from the RT-Druid Package and than the workspace selection window will appear as shown the following figure:
+
* Double-Click on '''eclipse.exe''' application located into ''eclipse'' folder extracted from the RT-Druid Package and then the workspace selection window will appear as shown the following figure:
  
 
[[File:Arduino tutorial 1.png|thumb|center|Figure 1: RT-Druid Eclipse IDE workspace selection.]]
 
[[File:Arduino tutorial 1.png|thumb|center|Figure 1: RT-Druid Eclipse IDE workspace selection.]]
Line 29: Line 31:
 
[[File:Arduino tutorial 2.png|thumb|center|Figure 2: RT-Druid Eclipse IDE welcome.]]
 
[[File:Arduino tutorial 2.png|thumb|center|Figure 2: RT-Druid Eclipse IDE welcome.]]
  
* Click on ''Welcome tab-sheet close'' button to show the default RT-Druid Eclipe IDE C/C++ perspective as shown in the following figure:
+
* Click on ''Welcome tab-sheet close'' button to show the default RT-Druid Eclipse IDE C/C++ perspective as shown in the following figure:
  
 
[[File:Arduino tutorial 3.png|thumb|center|Figure 3: RT-Druid Eclipse IDE C/C++ perspective.]]
 
[[File:Arduino tutorial 3.png|thumb|center|Figure 3: RT-Druid Eclipse IDE C/C++ perspective.]]
Line 35: Line 37:
 
= RT-Druid Preferences =
 
= RT-Druid Preferences =
  
The RT-Druid code generator and makefiles need to make reference to external directories (e.g., for specifying the compiler path), or other configurations (such as serial port numbers, baud rates, ...).
+
The RT-Druid code generator and the makefile it generates need to make reference to external values, typically named "preferences".
 +
These preferences typically store:
 +
* directories (e.g., for specifying the compiler path)
 +
* other configurations (e.g., as serial port numbers, baud rates, ...)
  
* Click on ''Window->Preferences'' menu entry as shown in the following figure:
+
RT-Druid stores the preferences inside the workspace. The following screenshots show how to modify the RT-Druid preferences. Each preference is then described in the specific architecture port.
  
[[File:Arduino tutorial 11.png|thumb|center|Figure 11: RT-Druid Eclipse Preferences.]]
+
To open the preferences window, please click on ''Window->Preferences'' menu entry as shown in the following figure:
  
* ERIKA PREFERENCES
+
[[File:Arduino tutorial 11.png|thumb|center|Figure 4: RT-Druid Eclipse Preferences.]]
  
[[File:Erika3 preferences.png|thumb|center|Figure 12: Erika Preferences.]]
+
The first setting page which can be altered is related to the location of the ERIKA v3 codebase. In particular, the codebase can be stored in various locations, and the tool needs to know where to retrieve the code. The possible options are:
 +
* Auto - the location is automatically defined by the tool (typically the ERIKA v3 source code is distributed inside an Eclipse plugin);
 +
* Manual - you can manually specify a root directory (useful in case you have a separate repository on your PC that you want to use;
 +
* ERIKA_FILES / common_oil.pref - in these two cases the tool will retrieve the location either from the ERIKA_FILES environment variable, or from the ERIKA_FILES variable specified in the preference file common_oil.pref
 +
* Plugins - In this case, the code will be pulled from the specific ERIKA v3 plugin installed in the current eclipse installation.
  
* The RT-Druid Eclipse Preferences window will open as shown in the following figure:
 
  
[[File:Arduino tutorial 12.png|thumb|center|Figure 13: RT-Druid Eclipse Preferences OIL.]]
+
[[File:Erika3 preferences.png|thumb|center|Figure 5: Erika Preferences.]]
  
 +
The second setting page, as shown in the following figure, lists the available properties which can be modified by the user (you can double-click on a property to modify its value; on newer versions, properties have a hierarchy).
  
For more details about RT-Druid Configuration, see the [[RT-Druid_configuration|RT-Druid configuraiton wiki page]].
+
[[File:Arduino tutorial 12.png|thumb|center|Figure 6: RT-Druid Eclipse Preferences OIL.]]
 +
 
 +
For more details about RT-Druid Configuration, see the [[RT-Druid_configuration|RT-Druid configuration wiki page]].
  
 
= RT-Druid Project =
 
= RT-Druid Project =
 +
 +
To create an RT-Druid Project, please follow the steps below:
  
 
* Click on ''File->New->RT-Druid v3 Oil and C/C++ Project'' menu entry as shown in the following figure:
 
* Click on ''File->New->RT-Druid v3 Oil and C/C++ Project'' menu entry as shown in the following figure:
  
[[File:Arduino tutorial 4.png|thumb|center|Figure 4: RT-Druid v3 Oil and C/C++ Project.]]
+
[[File:Arduino tutorial 4.png|thumb|center|Figure 7: RT-Druid v3 Oil and C/C++ Project.]]
  
 
* The ''RT-Druid C/C++ Project Wizard'' will open as shown in the following figure:
 
* The ''RT-Druid C/C++ Project Wizard'' will open as shown in the following figure:
  
[[File:Arduino tutorial 5.png|thumb|center|Figure 5: RT-Druid C/C++ Project Wizard.]]
+
[[File:Arduino tutorial 5.png|thumb|center|Figure 8: RT-Druid C/C++ Project Wizard.]]
  
* Type the name of the the project in the ''Project name'' text-box: ''ArduinoEE3'' for example.
+
* Type the name of the project in the ''Project name'' text-box: ''ArduinoEE3'' for example.
  
 
* If you are using Windows OS, you should select the ''Cygwin GCC'' toolchain, and then click on the ''Next'' button.
 
* If you are using Windows OS, you should select the ''Cygwin GCC'' toolchain, and then click on the ''Next'' button.
Line 68: Line 81:
 
* The wizard will show the window to select a project template as shown in the following figure:
 
* The wizard will show the window to select a project template as shown in the following figure:
  
[[File:Arduino tutorial 6.png|thumb|center|Figure 6: RT-Druid Project Template Wizard.]]
+
[[File:Arduino tutorial 6.png|thumb|center|Figure 9: RT-Druid Project Template Wizard.]]
  
* Click on ''Create a project using one of these templates'' check-box to let the Template Wizard to show the available templates as shown in the following figure:
+
* Click on ''Create a project using one of these templates'' check-box to let the Template Wizard show the available templates as illustrated in the following figure:
  
[[File:Arduino tutorial 7.png|thumb|center|Figure 7: RT-Druid Available Templates Wizard.]]
+
[[File:Arduino tutorial 7.png|thumb|center|Figure 10: RT-Druid Available Templates Wizard.]]
  
* As example, expand ''AVR8'' and ''Arduino Uno'' entries and choose a desired template to instantiate: ''Full Demo 2'' for example.
+
* As an example, expand ''AVR8'' and ''Arduino Uno'' entries and choose the desired template to instantiate: ''Full Demo 2'' for example.
  
 
* Finally, click on ''Finish'' button to instantiate an RT-Druid Eclipse project from a chosen template as shown in the following figure:  
 
* Finally, click on ''Finish'' button to instantiate an RT-Druid Eclipse project from a chosen template as shown in the following figure:  
  
[[File:Arduino tutorial 8.png|thumb|center|Figure 8: RT-Druid Eclipse Project.]]
+
[[File:Arduino tutorial 8.png|thumb|center|Figure 11: RT-Druid Eclipse Project.]]
  
 
= Building a project =
 
= Building a project =
 +
 +
To build an RT-Druid Project, please follow the steps below:
  
 
* Right-Click on your project, as example ''ArduinoEE3'', shown in the Eclipse ''Project Explorer'' panel, and then click on ''Build Project'' context-menu entry as shown in the following figure:
 
* Right-Click on your project, as example ''ArduinoEE3'', shown in the Eclipse ''Project Explorer'' panel, and then click on ''Build Project'' context-menu entry as shown in the following figure:
  
[[File:Arduino tutorial 19.png|thumb|center|Figure 19: Erika project build.]]
+
[[File:Arduino tutorial 19.png|thumb|center|Figure 12: Erika project build.]]
  
* The build process start as shown in the following figure:
+
* The build process starts as shown in the following figure:
  
[[File:Arduino tutorial 20.png|thumb|center|Figure 20: Erika build process.]]
+
[[File:Arduino tutorial 20.png|thumb|center|Figure 13: Erika build process.]]
  
 
* The build process ends successfully as shown in the following figure:
 
* The build process ends successfully as shown in the following figure:
  
[[File:Arduino tutorial 21.png|thumb|center|Figure 21: Erika build successfully.]]
+
[[File:Arduino tutorial 21.png|thumb|center|Figure 14: Erika build successfully.]]
 +
 
 +
= ERIKA distribution clean =
 +
 
 +
To completely clean your project, you have to remove both generated and compiled files. This is done using the ''Clean Erika'' functions, as explained below.
 +
 
 +
* Right-Click on your project, as example ''ArduinoEE3'', shown in the Eclipse ''Project Explorer'' panel, and then click on ''Clean Erika'' context-menu entry as shown in the following figure:
 +
 
 +
[[File:Arduino tutorial 17.png|thumb|center|Figure 15: Erika Clean.]]
 +
 
 +
* The ''Clean up Erika Files'' dialog window will appear as shown in the following figure:
 +
 
 +
[[File:Arduino tutorial 18.png|thumb|center|Figure 16: Clean up Erika Files.]]
 +
 
 +
* Click on ''Yes'' button to clean the entire Erika distribution.
 +
 
 +
'''NOTE:''' the distribution folder will be automatically regenerated, if the flag ''Build Automatically'' is enabled.
 +
 
 +
[[File:Eclipse_build_automaitcally.png|thumb|center|Figure 17: Build automatically flag.]]
 +
 
 +
'''NOTE:''' this operation may be necessary every time an Erika or RT-Druid configuration property is modified.
 +
 
 +
= Anatomy of an ERIKA v3 Project =
 +
 
 +
The structure of an ERIKA3 Project is as follows:
  
= Anatomy of a ERIKA v3 Project =
+
* The application code and the OIL File are stored in the project directory
* explain the directories
+
* The compilation workflow is as follows:
* explain the role of each directory / main files
+
** RT-Druid reads the OIL file, and generates:
* check the auto-generated documenattion...
+
*** erika/pull/*
 +
*** erika/makefile
 +
*** erika/osSignature.oil
 +
*** out/ee_applcfg.*
 +
*** out/applSignature.oil
 +
*** out/makefile
 +
** The out/makefile first builds the ERIKA library, and then compiles the application
 +
** The building of the ERIKA library has three phases:
 +
*** Pull phase: based on erika/osSignature.oil, the system knows what to copy in the erika/inc and erika/src directories from the ERIKA repository (typically stored in the Eclipse plugins) for the library build
 +
*** Doxygen Phase: based on the source code, the Doxygen documentation is generated
 +
*** Compilation Phase: the ERIKA library is then compiled.
 +
* The compilation process creates at the end the following directories:
 +
** <tt>erika</tt> - This directory stores all the files related to ERIKA v3
 +
*** <tt>dbg</tt> - Debug scripts (typically related to GDB, Lauterbach TRACE32, or to iSystem WinIDEA)
 +
*** <tt>doc</tt> - Doxygen documentation, generated automatically when building the project (only if Doxygen is installed!)
 +
*** <tt>inc</tt> - The ERIKA include files, copied in the local project
 +
*** <tt>lib</tt> - The compiled libraries
 +
*** <tt>mk</tt> - The makefiles used for compiling the library
 +
*** <tt>obj</tt> - The object files used to assemble the library
 +
*** <tt>pull</tt> - These are the only files generated by RT-Druid under ERIKA. all the rest is generated from the pull makefile!
 +
*** <tt>src</tt> - The source code of ERIKA, copied in the local project
 +
*** <tt>makefile</tt> - the main makefile for compiling the ERIKA library
 +
*** <tt>osSignature.oil</tt> - the OIL file signature. This part is basically the "configuration" part of the library, and it is a subset of the application OIL file. RT-Druid re-generates the files ONLY if the signature does not match the current OIL file.
 +
** <tt>out</tt> - This directory stores all the files related to the application, included the final binaries
 +
*** <tt>applSignature.oil</tt> - the application OIL signature, which is basically the OIL file re-exported by the tool
 +
*** <tt>ee_applcfg.*</tt> - the application configuration generated by RT-Druid
 +
*** <tt>makefile</tt> - the main application makefile
  
 
= Per Architecture tutorials =
 
= Per Architecture tutorials =
* list of the available tutorials (AVR8)
+
* [[AVR8_-_Arduino_application_build_on_Windows|AVR8: Arduino application build on Windows]]
 +
* [[Microchip_dsPIC33/PIC24_-_dsPIC33EV-SK_application_build_on_Windows|dsPIC33/PIC24: dsPIC33EV-SK application build on Windows]]
 +
* [[Microchip_MPLAB-X_-_Integration_on_Windows| MPLAB-X IDE - Integration on Windows]]
 +
* [[:Category:Tutorial|''All Tutorials'']]
 +
 
 +
= See also =
 +
* [[EForms Oil Editor]]

Latest revision as of 19:04, 11 January 2019

Prerequisites

The following is the list of software that should be already be installed in your system before installing ERIKA v3:

Downloading ERIKA v3 and RT-Druid

  • RT-Druid can be downloaded using the download web page
  • To download RT-Druid, you have to accept the RT-Druid and the ERIKA v3 licenses
    • The ERIKA v3 license is a GPL v2, whereas the RT-Druid license is a proprietary license that allows you to use the provided version of RT-Druid at no cost
  • Here is possible to find more details about the release scheduling and build numbers of RT-Druid packaging.

Installing RT-Druid

RT-Druid is provided as a compressed archive, which can be unpacked in your user directories. On Windows machines, we typically unpack the tool under C:\Evidence\versionnumber, where 'versionnumber' is the build number.

Starting RT-Druid

  • Double-Click on eclipse.exe application located into eclipse folder extracted from the RT-Druid Package and then the workspace selection window will appear as shown the following figure:
Figure 1: RT-Druid Eclipse IDE workspace selection.
  • Browse the File-System to select Workspace folder and then click on the OK button to let the RT-Druid Eclipse IDE start as shown in the following figure:
Figure 2: RT-Druid Eclipse IDE welcome.
  • Click on Welcome tab-sheet close button to show the default RT-Druid Eclipse IDE C/C++ perspective as shown in the following figure:
Figure 3: RT-Druid Eclipse IDE C/C++ perspective.

RT-Druid Preferences

The RT-Druid code generator and the makefile it generates need to make reference to external values, typically named "preferences". These preferences typically store:

  • directories (e.g., for specifying the compiler path)
  • other configurations (e.g., as serial port numbers, baud rates, ...)

RT-Druid stores the preferences inside the workspace. The following screenshots show how to modify the RT-Druid preferences. Each preference is then described in the specific architecture port.

To open the preferences window, please click on Window->Preferences menu entry as shown in the following figure:

Figure 4: RT-Druid Eclipse Preferences.

The first setting page which can be altered is related to the location of the ERIKA v3 codebase. In particular, the codebase can be stored in various locations, and the tool needs to know where to retrieve the code. The possible options are:

  • Auto - the location is automatically defined by the tool (typically the ERIKA v3 source code is distributed inside an Eclipse plugin);
  • Manual - you can manually specify a root directory (useful in case you have a separate repository on your PC that you want to use;
  • ERIKA_FILES / common_oil.pref - in these two cases the tool will retrieve the location either from the ERIKA_FILES environment variable, or from the ERIKA_FILES variable specified in the preference file common_oil.pref
  • Plugins - In this case, the code will be pulled from the specific ERIKA v3 plugin installed in the current eclipse installation.


Figure 5: Erika Preferences.

The second setting page, as shown in the following figure, lists the available properties which can be modified by the user (you can double-click on a property to modify its value; on newer versions, properties have a hierarchy).

Figure 6: RT-Druid Eclipse Preferences OIL.

For more details about RT-Druid Configuration, see the RT-Druid configuration wiki page.

RT-Druid Project

To create an RT-Druid Project, please follow the steps below:

  • Click on File->New->RT-Druid v3 Oil and C/C++ Project menu entry as shown in the following figure:
Figure 7: RT-Druid v3 Oil and C/C++ Project.
  • The RT-Druid C/C++ Project Wizard will open as shown in the following figure:
Figure 8: RT-Druid C/C++ Project Wizard.
  • Type the name of the project in the Project name text-box: ArduinoEE3 for example.
  • If you are using Windows OS, you should select the Cygwin GCC toolchain, and then click on the Next button.
  • The wizard will show the window to select a project template as shown in the following figure:
Figure 9: RT-Druid Project Template Wizard.
  • Click on Create a project using one of these templates check-box to let the Template Wizard show the available templates as illustrated in the following figure:
Figure 10: RT-Druid Available Templates Wizard.
  • As an example, expand AVR8 and Arduino Uno entries and choose the desired template to instantiate: Full Demo 2 for example.
  • Finally, click on Finish button to instantiate an RT-Druid Eclipse project from a chosen template as shown in the following figure:
Figure 11: RT-Druid Eclipse Project.

Building a project

To build an RT-Druid Project, please follow the steps below:

  • Right-Click on your project, as example ArduinoEE3, shown in the Eclipse Project Explorer panel, and then click on Build Project context-menu entry as shown in the following figure:
Figure 12: Erika project build.
  • The build process starts as shown in the following figure:
Figure 13: Erika build process.
  • The build process ends successfully as shown in the following figure:
Figure 14: Erika build successfully.

ERIKA distribution clean

To completely clean your project, you have to remove both generated and compiled files. This is done using the Clean Erika functions, as explained below.

  • Right-Click on your project, as example ArduinoEE3, shown in the Eclipse Project Explorer panel, and then click on Clean Erika context-menu entry as shown in the following figure:
Figure 15: Erika Clean.
  • The Clean up Erika Files dialog window will appear as shown in the following figure:
Figure 16: Clean up Erika Files.
  • Click on Yes button to clean the entire Erika distribution.

NOTE: the distribution folder will be automatically regenerated, if the flag Build Automatically is enabled.

Figure 17: Build automatically flag.

NOTE: this operation may be necessary every time an Erika or RT-Druid configuration property is modified.

Anatomy of an ERIKA v3 Project

The structure of an ERIKA3 Project is as follows:

  • The application code and the OIL File are stored in the project directory
  • The compilation workflow is as follows:
    • RT-Druid reads the OIL file, and generates:
      • erika/pull/*
      • erika/makefile
      • erika/osSignature.oil
      • out/ee_applcfg.*
      • out/applSignature.oil
      • out/makefile
    • The out/makefile first builds the ERIKA library, and then compiles the application
    • The building of the ERIKA library has three phases:
      • Pull phase: based on erika/osSignature.oil, the system knows what to copy in the erika/inc and erika/src directories from the ERIKA repository (typically stored in the Eclipse plugins) for the library build
      • Doxygen Phase: based on the source code, the Doxygen documentation is generated
      • Compilation Phase: the ERIKA library is then compiled.
  • The compilation process creates at the end the following directories:
    • erika - This directory stores all the files related to ERIKA v3
      • dbg - Debug scripts (typically related to GDB, Lauterbach TRACE32, or to iSystem WinIDEA)
      • doc - Doxygen documentation, generated automatically when building the project (only if Doxygen is installed!)
      • inc - The ERIKA include files, copied in the local project
      • lib - The compiled libraries
      • mk - The makefiles used for compiling the library
      • obj - The object files used to assemble the library
      • pull - These are the only files generated by RT-Druid under ERIKA. all the rest is generated from the pull makefile!
      • src - The source code of ERIKA, copied in the local project
      • makefile - the main makefile for compiling the ERIKA library
      • osSignature.oil - the OIL file signature. This part is basically the "configuration" part of the library, and it is a subset of the application OIL file. RT-Druid re-generates the files ONLY if the signature does not match the current OIL file.
    • out - This directory stores all the files related to the application, included the final binaries
      • applSignature.oil - the application OIL signature, which is basically the OIL file re-exported by the tool
      • ee_applcfg.* - the application configuration generated by RT-Druid
      • makefile - the main application makefile

Per Architecture tutorials

See also