Compiling Bela projects in Eclipse » History » Version 9

« Previous - Version 9/36 (diff) - Next » - Current version
Andrew McPherson, 2014-11-07 08:06 PM


Compiling projects with BeagleRT

This document contains information on how to compile the BeagleRT software and upload it onto the BeagleBone Black.

Required tools

This document assumes you have the following tools installed:

  • Working Linux system, either running natively or on a virtual machine
  • Mercurial version control system (http://mercurial.selenic.com). Available as a package in most Linux distributions.
  • arm-gcc hardfp compiler toolchain (i.e. arm-linux-gnueabihf-gcc and similar. On Ubuntu, these can be installed from packages:
    sudo apt-get install gcc-arm-linux-gnueabihf
    sudo apt-get install g++-arm-linux-gnueabihf
    
  • Eclipse IDE (http://www.eclipse.org), including the C/C++ development tools
  • Xenomai libraries compiled for ARM hardfp (details to come)

Getting started

  1. Clone the BeagleRT files from the repository:
    hg clone https://code.soundsoftware.ac.uk/hg/beaglert
    
  2. Launch Eclipse and select a workspace (creating one if necessary).
  3. In the Eclipse menu bar, choose File -> Import.... Within the dialog box that appears, choose General -> Existing Projects into Workspace. Click Next.
  4. Click the button Select root directory and choose the path to the BeagleRT repository you just cloned.
  5. Make sure the BeagleRT project is selected, and under Options, untick Copy projects into workspace. Click Finish to complete the project import.

Compiling the BeagleRT project

  1. In Eclipse, right-click on the BeagleRT project folder in the left-hand column, and choose Build Project. (If you don't see the list of projects, make sure the C/C++ Perspective is active in Eclipse, and choose Window -> Show View -> Project Explorer.)
  2. The project should compile without errors, and the results should be visible in the Console tab (typically in the bottom pane of the window)
  3. If any errors arise, check that you have all the dependencies installed, both header files and libraries.

Copying BeagleRT projects to the BeagleBone Black

  1. Once the project has compiled, open a terminal window and cd to the directory where the binary was compiled. For example, if you installed BeagleRT in your home directory: cd ~/BeagleRT/Release
  2. Copy the BeagleRT executable to the BeagleBone Black using scp (entering your BeagleBone Black password when prompted; you may need to create the beaglert directory first):
    scp BeagleRT root@192.168.7.2:~/beaglert/
    
  3. The first time you install BeagleRT, you also need to copy the pru_rtaudio.bin file to the BeagleBone Black. This can be found at the top level of the BeagleRT repository, and it should be copied to the same directory on the BeagleBone where the BeagleRT executable is located:
    scp pru_rtaudio.bin root@192.168.7.2:~/beaglert/
    

Selecting different BeagleRT examples within the Eclipse project

The Eclipse project contains several examples within the projects directory. Follow these steps to choose which one to compile:

  1. Only one of the folders within projects should be enabled at a time. This one will be in solid black text; the remainder will be grey.
  2. Right-click on the folder which is currently enabled (solid black). Choose Resource Configurations -> Exclude from Build...
  3. Click Select All to disable the code in this folder. Click OK.
  4. Now right-click on the folder which you want to enable. Choose Resource Configurations -> Exclude from Build...
  5. Click Deselect All to enable the code in this folder. Click OK.