8. Cross Development in Raspbian¶
8.1. Roverapp Software Development Kit (SDK) Extension for Raspbian¶
Roverapp Software Development Kit (SDK) Extension features include files and library files for the dependencies of the Rover for Cross development. While it is tested with SysGCC Cross toolchain for Raspberry Pi, it is able to work with many others.
Roverapp Software Development Kit (SDK) Extension for Raspbian is maintained under the following Git repository: https://github.com/app4mc-rover/rover-app-raspbian-cross-sdk.
8.2. Cross Development with Windows using Eclipse CDT and rover-app-raspbian-cross-sdk¶
In this section, cross development using Eclipse CDT IDE in Windows platform is explained.
8.2.1. Step 1: Windows Toolchain Setup¶
Raspberry Pi toolchain installations for Windows are provided in this website. Download raspbian-jessie or raspbian-stretch toolchain to match which distro used in the rover.
8.2.2. Step 2: Downloading and Installing Eclipse¶
Next step is to download the Eclipse CDT. Follow these steps :Eclipse IDE Setup.
8.2.3. Step 3: Setting Up Cross Compiler in Eclipse¶
Now that Eclipse is running, the next step is to set up the cross compiler aligned with the Raspberry Pi toolchain : Cross Compiler Setup.
roverapp for the project name while creating a new project.
8.2.4. Step 4: Downloading rover-app¶
Now that your project named
roverapp exists, you can download or clone roverapp repository contents and put it in your project folder. Example way to achieve this in Linux is given below:
1 2 3 4 cd /path/to/your/project git clone https://github.com/app4mc-rover/rover-app.git cp -r rover-app/* . rm -rf rover-app
8.2.5. Step 5: Downloading rover-app-raspbian-cross-sdk¶
To start using the SDK extension, download or clone the contents of the Git repository to a known location of your choice.
1 git clone https://github.com/app4mc-rover/rover-app-raspbian-cross-sdk.git
8.2.6. Step 6: Configuring Environment Variables¶
Paths discussed in this documentation are given relatively. Some environment variables including these paths need to be declared in Eclipse.
To achieve this, go to Properties for your project > C/C++ Build > Environment. Following variables should be declared:
Example Value: C:\SysGCC\Raspberry
Example Value: C:\path\to\your\project\roverapp
Example Value: C:\path\to\rover-app-raspbian-cross-sdk
An example declaration of those environment variables are shown in the following image:
8.2.7. Step 7: Cross Settings¶
To make sure Eclipse CDT knows about your cross development toolchain, Cross settings must be completed as shown below under Properties for your project > C/C++ Build > Settings > Tool Settings > Cross Settings:
8.2.8. Step 8: Run Configurations¶
From Run > Run Configurations, create a new run configuration and apply the following changes.
Under Connection in Run Configurations, enter your SSH credentials.
In order to avoid certain authentication problems, connecting as root can be considered.
8.2.9. Step 9: Editing Preprocessor Definitions (-D)¶
Rover-app software is designed so that it compiles different files using different compilers. When cross debugging using Eclipse CDT,
CROSS_COMPILE_ECLIPSE preprocessor definition must be declared.
To achieve this, locate to Properties for your project > C/C++ Build > Settings > Tool Settings > Cross GCC Compiler > Preprocessor and Properties for your project > C/C++ Build > Settings > Tool Settings > Cross G++ Compiler > Preprocessor and add the preprocessor definition as shown below:
8.2.10. Step 10: Adjusting Include Paths (-I)¶
Include paths for the GNU toolchain should be specified in order to compile both internal and precompiled libraries. To do this with rover-app-raspbian-cross-sdk following steps should be done:
- Go to Properties for your project > C/C++ Build > Settings > Tool Settings > Cross GCC Compiler > Includes and add the following to Include Paths (-I)
- Go to Properties for your project > C/C++ Build > Settings > Tool Settings > Cross G++ Compiler > Includes and add the following to Include Paths (-I)
At the end, it should look like the following (roughly):