Remote projects on RT-Druid
Contents
Introduction
There are some scenarios in which the board has the processing capabilities for running a full compiler for native building.
This is the case, for example, of powerful multi-core ARM SoCs running a Linux distribution, where we may use a hypervisor like Jailhouse for running ERIKA alongside Linux.
In such circumstances, having a native compilation of ERIKA on the target could be easier than cross-compiling using a host machine.
Unfortunately, the Eclipse IDE requires an x86 platform with a fair amount of resources (in terms of both processing and memory).
This guide, therefore, explains how to set-up Eclipse on a host x86 machine, leaving the compilation process on the target.
Handling a remote project can be done manually, of course, by transferring the built files through ftp/scp/rsync or by mounting locally the target filesystem using nfs/sshfs.
However, this guide explains how to use the remote project feature of Eclipse, which internally relies on the sftp protocol.
Important: the code of ERIKA must be available on the target because it is needed by the build process. Similarly, all the tools and the environment variables needed by the building process must be available/set on the target.
Plugins installation
To add the support for remote projects, it is necessary to install two plugins:
- Remote System Explorer User Actions
- TM Terminal
These plugins can be easily installed through the typical steps for installing a plugin:
-
Menu
→Help
→Install new Software
- Select the update site of Eclipse (e.g., neon)
- Search General Purpose Tools
- Select the following plugins:
- Remote System Explorer User Actions
which adds support for remote projects - TM Terminal
which allows opening an SSH shell within Eclipse
- Remote System Explorer User Actions
- Click in
Next
to finish the installation, and then restart Eclipse
Establishing a connection
Once Eclipse has been restarted, follow the next steps to establish an SSH connection with the target.
- Open the Remote System Explorer perspective (press the button on the right top)
- From the Remote System view, press the right mouse button on local and create a new connection
- Select SSH Only
- Specify the connection parameters
This way, a new connection will be created. - Clicking the Sftp branch, Eclipse will ask the credentials to access the file
- On the remote filesystem, select the directory that will host the project.
Then, click the right mouse button and select Create Remote Project - Going back to the C/C++ perspective, it will be possible to see the remote project and, in case, generate the code for ERIKA.
OIL support
If the directory selected for the remote project does not yet contain an "RT-Druid" project, the generation of the configuration files for ERIKA won't be supported. Follow the next steps to enable such functionality:
- Click the right mouse button on the project in the Project Explorer window
- Select the Configure item
- Click the Add RT-Druid Builder sub-item
Once this operation is finished, the project will be able of generating the configuration of ERIKA, but still needs to be configured.
In particular, we need to provide the following information:
- which OIL file contains the system configuration;
- the path of ERIKA;
- the path of the generator files.
This information can be provided through the following steps:
- Open the project properties (i.e., by clocking with the right button on the project, or selecting
Project
→Properties
once the project has been selected).
- Select the Oil item and specify the oil file through the Browse button
- Select the Erika Files Location item and:
- In the Manual box, specify the path of ERIKA on the target
- Specify the path on the local filesystem where the RT-Druid packet is located
- Click Ok to complete the configuration
Generation
Currently, if the automatic build flag is checked (in the Project
menu), RT-Druid tries to re-generate the ERIKA configuration files whenever the OIL file specified in the project properties is saved.
It is possible to delete the ERIKA folders by clicking with the right mouse button on the project and selecting the Clean Erika item.
The deleted folders can be regenerated through the following steps:
- Change and modify the OIL file
- Clean and then rebuild the project
Note that when the automatic build is not enabled, the system automatically asks if to start a project build.
SSH console
Once the TM Terminal plugin has been installed (as explained above), it is possible to open a view containing an SSH console.
The next steps show how to use this console for building the binary on the target through the make
command.
- Open a new view (
Menu
→Window
→Show View
→Other...
) and search Terminal:
- Press the button on the right of the Terminal view to create a new connection:
- Select SSH and specify the connection parameters:
- Once the console has been created, it is possible to use the typical remote commands (e.g.,
cd
andls
):
- Run the
make
command to build ERIKA:
Notes
- Currently, Acceleo is not capable of generating files on top of the Eclipse virtualization. The generation is therefore done in two steps:
- Acceleo generates files in a directory within the local workspace:
.metadata/.plugins/com.eu.evidence.rtdruid3.oil.cdt.ui/oil_gen
- RT-Druid copies the files from the local to the remote directory (using the Eclipse virtualization)
- Acceleo generates files in a directory within the local workspace: