Difference between revisions of "AVR8 - Arduino application build on Windows"

From ERIKA WIKI
Jump to: navigation, search
(RT-Druid Template Project)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
= Synopsys =
 
= Synopsys =
This guide describes the how to build and run a first ERIKA Enterprise v3 application for [https://store.arduino.cc/arduino-uno-rev3 Arduino UNO] boards.
+
This guide illustrates how to build and run a first ERIKA Enterprise v3 application for [https://store.arduino.cc/arduino-uno-rev3 Arduino UNO] boards.
  
 
= RT-Druid Eclipse IDE =
 
= RT-Druid Eclipse IDE =
  
* 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 the '''eclipse.exe''' application located in the ''eclipse'' folder extracted from the RT-Druid Package. Then, the workspace selection window will appear as shown in 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.]]
  
* 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:
+
* 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:
  
 
[[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 the ''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 26: Line 26:
 
[[File:Arduino tutorial 5.png|thumb|center|Figure 5: RT-Druid C/C++ Project Wizard.]]
 
[[File:Arduino tutorial 5.png|thumb|center|Figure 5: 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 (e.g., ''ArduinoEE3'').
  
* Make sure the ''Cygwin GCC'' toolchain is selected and the click on the ''Next'' button.
+
* Make sure the ''Cygwin GCC'' toolchain is selected and then click on the ''Next'' button.
  
 
* 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:
Line 38: Line 38:
 
[[File:Arduino tutorial 7.png|thumb|center|Figure 7: RT-Druid Available Templates Wizard.]]
 
[[File:Arduino tutorial 7.png|thumb|center|Figure 7: RT-Druid Available Templates Wizard.]]
  
* Expand ''AVR8'' and ''Arduino Uno'' entries and choose a desired template to instatiate: "Full Demo 2" for example.
+
* Expand the ''AVR8'' and ''Arduino Uno'' entries and choose the desired template to instantiate: ''Full Demo 1'' for example.
  
* Finally, click on ''Finish'' butto to instatiate an RT-Druid Eclipse project from a choosen template as shown in the following figure:  
+
* Finally, click on the ''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 8: RT-Druid Eclipse Project.]]
Line 46: Line 46:
 
= Arduino UNO Serial Port =
 
= Arduino UNO Serial Port =
  
* Connect the Arduino UNO board to the PC via USB cable.
+
* Connect the Arduino UNO board to the PC via a USB cable.
  
 
* Open the Device Management of Windows executing (by Double-Click) the ''devmgmt.msc'' command located in ''C:\WINDOWS\System32'' as shown in the following figure:
 
* Open the Device Management of Windows executing (by Double-Click) the ''devmgmt.msc'' command located in ''C:\WINDOWS\System32'' as shown in the following figure:
Line 54: Line 54:
 
* The Device Management window will open.
 
* The Device Management window will open.
  
* Expand the ''Port (COM and LTP)'' entry to find the Arduino Uno COM port (COM3 for example) as as shown in the following figure:
+
* Expand the ''Port (COM and LTP)'' entry to find the Arduino Uno COM port (COM3 for example) as shown in the following figure:
  
 
[[File:Arduino tutorial 10.png|thumb|center|Figure 10: Arduino Uno COM port.]]
 
[[File:Arduino tutorial 10.png|thumb|center|Figure 10: Arduino Uno COM port.]]
Line 60: Line 60:
 
= RT-Druid Configuration =
 
= RT-Druid Configuration =
  
* Click on ''Window->Preferences'' menu entry as shown in the following figure:
+
* Click on the ''Window->Preferences'' menu entry as shown in the following figure:
  
 
[[File:Arduino tutorial 11.png|thumb|center|Figure 11: RT-Druid Eclipse Preferences.]]
 
[[File:Arduino tutorial 11.png|thumb|center|Figure 11: RT-Druid Eclipse Preferences.]]
Line 70: Line 70:
 
* Click the ''Generator Properties'' entry in the ''OIL'' section of the left panel to show the RT-Druid Generator Properties to configure.
 
* Click the ''Generator Properties'' entry in the ''OIL'' section of the left panel to show the RT-Druid Generator Properties to configure.
  
* Double-Click on the ''Arduino SDK'' Property to configure the Arduino SDK installation path as shown in the following figure:
+
* Double-click on the ''Arduino SDK'' property to configure the Arduino SDK installation path as shown in the following figure:
  
 
[[File:Arduino tutorial 13.png|thumb|center|Figure 13: RT-Druid Arduino SDK Path Property.]]
 
[[File:Arduino tutorial 13.png|thumb|center|Figure 13: RT-Druid Arduino SDK Path Property.]]
  
* Browse th File-System to select the Arduino SDK path (E.g. C:\Program Files (x86)\Arduino) and then click ''OK'' button.
+
* Browse the file-system to select the Arduino SDK path (E.g. C:\Program Files (x86)\Arduino) and then click the ''OK'' button.
  
* Double-Click on the ''Arduino Serial Port'' Property to configure the Arduino Serial Port as shown in the following figure:
+
* Double-click on the ''Arduino Serial Port'' property to configure the Arduino Serial Port as shown in the following figure:
  
 
[[File:Arduino tutorial 14.png|thumb|center|Figure 14: RT-Druid Arduino Serial Port Property.]]
 
[[File:Arduino tutorial 14.png|thumb|center|Figure 14: RT-Druid Arduino Serial Port Property.]]
Line 82: Line 82:
 
* Type the COM Port where the Arduino UNO Board is connected (E.g. COM3) and then click ''OK'' button.
 
* Type the COM Port where the Arduino UNO Board is connected (E.g. COM3) and then click ''OK'' button.
  
* Double-Click on the ''Arduino Serial Baudrate'' Property to configure the Arduino Serial Baudrate as shown in the following figure:
+
* Double-click on the ''Arduino Serial Baudrate'' Property to configure the Arduino Serial Baudrate as shown in the following figure:
  
 
[[File:Arduino tutorial 15.png|thumb|center|Figure 15: RT-Druid Arduino Serial Baudrate Property.]]
 
[[File:Arduino tutorial 15.png|thumb|center|Figure 15: RT-Druid Arduino Serial Baudrate Property.]]
  
* Type 115200 (the Arduino UNO Bootloader Baudrate) and then click ''OK'' button.
+
* Type 115200 (the Arduino UNO Bootloader Baudrate) and then click the ''OK'' button.
  
* Finally, click the ''OK'' button to confirm the configuration properties as shown in the followin figure:
+
* Finally, click the ''OK'' button to confirm the configuration properties as shown in the following figure:
  
 
[[File:Arduino tutorial 16.png|thumb|center|Figure 16: RT-Druid Configured Properties.]]
 
[[File:Arduino tutorial 16.png|thumb|center|Figure 16: RT-Druid Configured Properties.]]
  
 +
= ERIKA distribution clean =
 +
 +
* Right-Click on ''ArduinoEE3'' project into Eclipse ''Project Explorer'' panel and click on ''Clean Erika'' context-menu entry as shown in the following figure:
 +
 +
[[File:Arduino tutorial 17.png|thumb|center|Figure 17: 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 18: Clean up Erika Files.]]
 +
 +
* Click on the ''Yes'' button to clean the whole 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 19: Build automatically flag.]]
 +
 +
'''NOTE:''' this operation may be necessary every time an ERIKA or RT-Druid configuration property is modified.
 +
 +
= ERIKA project build =
 +
 +
* Right-click on ''ArduinoEE3'' project into Eclipse ''Project Explorer'' panel and click on ''Build Project'' context-menu entry as shown in the following figure:
 +
 +
[[File:Arduino tutorial 19.png|thumb|center|Figure 20: Erika project build.]]
 +
 +
* The build process starts as shown in the following figure:
 +
 +
[[File:Arduino tutorial 20.png|thumb|center|Figure 21: Erika build process.]]
 +
 +
* The build process ends successfully as shown in the following figure:
 +
 +
[[File:Arduino tutorial 21.png|thumb|center|Figure 22: Erika build successfully.]]
 +
 +
= Add Upload Build Target =
 +
 +
* Right-Click on ''ArduinoEE3'' project into Eclipse ''Project Explorer'' panel and click on ''Create...'' item of the ''Build Target'' context-menu entry, as shown in the following figure:
 +
 +
[[File:Arduino tutorial 22.png|thumb|center|Figure 23: Add Upload Build Target.]]
 +
 +
* The ''Create Build Target'' dialog window will appear as shown in the following figure:
 +
 +
[[File:Arduino tutorial 23.png|thumb|center|Figure 24: Create Build Target.]]
 +
 +
* Type ''upload'' into ''Target name'' text-box, uncheck the ''Run all project builders'' check-box and then click on ''OK'' button.
 +
 +
* The ''upload'' target will be created as shown in the following figure:
 +
 +
[[File:Arduino tutorial 24.png|thumb|center|Figure 25: Upload Target.]]
 +
 +
'''NOTE:'' this operation should be done once for every ERIKA project.
 +
 +
= Application Upload on Arduino Board =
 +
 +
* Double-Click on ''upload build target'' created in the previous section to start the upload process as shown in the following figure:
 +
 +
[[File:Arduino tutorial 26.png|thumb|center|Figure 26: Upload Process.]]
 +
 +
* The upload process ends successfully as shown in the following figure:
 +
 +
[[File:Arduino tutorial 25.png|thumb|center|Figure 27: Upload Process.]]
 +
 +
* Check the application running on Arduino UNO board connecting a serial terminal as shown in the following figure:
 +
 +
[[File:Arduino tutorial 27.png|thumb|center|Figure 28: Erika application.]]
  
 
= Additional Notes =
 
= Additional Notes =

Latest revision as of 18:01, 22 December 2017

Synopsys

This guide illustrates how to build and run a first ERIKA Enterprise v3 application for Arduino UNO boards.

RT-Druid Eclipse IDE

  • Double-click the eclipse.exe application located in the eclipse folder extracted from the RT-Druid Package. Then, the workspace selection window will appear as shown in 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 the 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 Template Project

  • Click on File->New->RT-Druid v3 Oil and C/C++ Project menu entry as shown in the following figure:
Figure 4: RT-Druid v3 Oil and C/C++ Project.
  • The RT-Druid C/C++ Project Wizard will open as shown in the following figure:
Figure 5: RT-Druid C/C++ Project Wizard.
  • Type the name of the project in the Project name text-box (e.g., ArduinoEE3).
  • Make sure the Cygwin GCC toolchain is selected 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 6: 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:
Figure 7: RT-Druid Available Templates Wizard.
  • Expand the AVR8 and Arduino Uno entries and choose the desired template to instantiate: Full Demo 1 for example.
  • Finally, click on the Finish button to instantiate an RT-Druid Eclipse project from a chosen template as shown in the following figure:
Figure 8: RT-Druid Eclipse Project.

Arduino UNO Serial Port

  • Connect the Arduino UNO board to the PC via a USB cable.
  • Open the Device Management of Windows executing (by Double-Click) the devmgmt.msc command located in C:\WINDOWS\System32 as shown in the following figure:
Figure 9: Device Management.
  • The Device Management window will open.
  • Expand the Port (COM and LTP) entry to find the Arduino Uno COM port (COM3 for example) as shown in the following figure:
Figure 10: Arduino Uno COM port.

RT-Druid Configuration

  • Click on the Window->Preferences menu entry as shown in the following figure:
Figure 11: RT-Druid Eclipse Preferences.
  • The RT-Druid Eclipse Preferences window will open as shown in the following figure:
Figure 12: RT-Druid Eclipse Preferences OIL.
  • Click the Generator Properties entry in the OIL section of the left panel to show the RT-Druid Generator Properties to configure.
  • Double-click on the Arduino SDK property to configure the Arduino SDK installation path as shown in the following figure:
Figure 13: RT-Druid Arduino SDK Path Property.
  • Browse the file-system to select the Arduino SDK path (E.g. C:\Program Files (x86)\Arduino) and then click the OK button.
  • Double-click on the Arduino Serial Port property to configure the Arduino Serial Port as shown in the following figure:
Figure 14: RT-Druid Arduino Serial Port Property.
  • Type the COM Port where the Arduino UNO Board is connected (E.g. COM3) and then click OK button.
  • Double-click on the Arduino Serial Baudrate Property to configure the Arduino Serial Baudrate as shown in the following figure:
Figure 15: RT-Druid Arduino Serial Baudrate Property.
  • Type 115200 (the Arduino UNO Bootloader Baudrate) and then click the OK button.
  • Finally, click the OK button to confirm the configuration properties as shown in the following figure:
Figure 16: RT-Druid Configured Properties.

ERIKA distribution clean

  • Right-Click on ArduinoEE3 project into Eclipse Project Explorer panel and click on Clean Erika context-menu entry as shown in the following figure:
Figure 17: Erika Clean.
  • The Clean up Erika Files dialog window will appear as shown in the following figure:
Figure 18: Clean up Erika Files.
  • Click on the Yes button to clean the whole ERIKA distribution.

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

Figure 19: Build automatically flag.

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

ERIKA project build

  • Right-click on ArduinoEE3 project into Eclipse Project Explorer panel and click on Build Project context-menu entry as shown in the following figure:
Figure 20: Erika project build.
  • The build process starts as shown in the following figure:
Figure 21: Erika build process.
  • The build process ends successfully as shown in the following figure:
Figure 22: Erika build successfully.

Add Upload Build Target

  • Right-Click on ArduinoEE3 project into Eclipse Project Explorer panel and click on Create... item of the Build Target context-menu entry, as shown in the following figure:
Figure 23: Add Upload Build Target.
  • The Create Build Target dialog window will appear as shown in the following figure:
Figure 24: Create Build Target.
  • Type upload into Target name text-box, uncheck the Run all project builders check-box and then click on OK button.
  • The upload target will be created as shown in the following figure:
Figure 25: Upload Target.

'NOTE: this operation should be done once for every ERIKA project.

Application Upload on Arduino Board

  • Double-Click on upload build target created in the previous section to start the upload process as shown in the following figure:
Figure 26: Upload Process.
  • The upload process ends successfully as shown in the following figure:
Figure 27: Upload Process.
  • Check the application running on Arduino UNO board connecting a serial terminal as shown in the following figure:
Figure 28: Erika application.

Additional Notes

T.B.D.