Compiling Bela projects in Eclipse » History » Version 6

Andrew McPherson, 2014-11-07 08:00 PM

1 1 Andrew McPherson
h1.  Compiling projects with BeagleRT
2 1 Andrew McPherson
3 1 Andrew McPherson
This document contains information on how to compile the BeagleRT software and upload it onto the BeagleBone Black.
4 1 Andrew McPherson
5 1 Andrew McPherson
h2. Required tools
6 1 Andrew McPherson
7 3 Andrew McPherson
This document assumes you have the following tools installed:
8 3 Andrew McPherson
9 1 Andrew McPherson
* Working Linux system, either running natively or on a virtual machine
10 3 Andrew McPherson
* Mercurial version control system (http://mercurial.selenic.com). Available as a package in most Linux distributions.
11 1 Andrew McPherson
* arm-gcc hardfp compiler toolchain (i.e. @arm-linux-gnueabihf-gcc@ and similar. On Ubuntu, these can be installed from packages:
12 1 Andrew McPherson
<pre>
13 1 Andrew McPherson
sudo apt-get install gcc-arm-linux-gnueabihf
14 1 Andrew McPherson
sudo apt-get install g++-arm-linux-gnueabihf
15 2 Andrew McPherson
</pre>
16 6 Andrew McPherson
* Eclipse IDE (http://www.eclipse.org), including the C/C++ development tools
17 1 Andrew McPherson
* Xenomai libraries compiled for ARM hardfp _(details to come)_
18 3 Andrew McPherson
19 3 Andrew McPherson
h2. Getting started
20 3 Andrew McPherson
21 3 Andrew McPherson
# Clone the BeagleRT files from the repository:
22 3 Andrew McPherson
<pre>
23 3 Andrew McPherson
hg clone https://code.soundsoftware.ac.uk/hg/beaglert
24 3 Andrew McPherson
</pre>
25 3 Andrew McPherson
# Launch Eclipse and select a workspace (creating one if necessary).
26 4 Andrew McPherson
# In the Eclipse menu bar, choose _File -> Import..._. Within the dialog box that appears, choose _General -> Existing Projects into Workspace_. Click _Next_.
27 4 Andrew McPherson
# Click the button _Select root directory_ and choose the path to the BeagleRT repository you just cloned.
28 1 Andrew McPherson
# Make sure the @BeagleRT@ project is selected, and under Options, untick _Copy projects into workspace_. Click _Finish_ to complete the project import.
29 6 Andrew McPherson
30 6 Andrew McPherson
h2. Compiling the BeagleRT project
31 6 Andrew McPherson
32 6 Andrew McPherson
# 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_.)
33 6 Andrew McPherson
# The project should compile without errors, and the results should be visible in the Console tab (typically in the bottom pane of the window)
34 6 Andrew McPherson
# If any errors arise, check that you have all the dependencies installed, both header files and libraries.
35 6 Andrew McPherson
36 6 Andrew McPherson
h2. Copying BeagleRT projects to the BeagleBone Black
37 6 Andrew McPherson
38 6 Andrew McPherson
# 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@
39 6 Andrew McPherson
# Copy the BeagleRT binary to the BeagleBone Black using @scp@ (entering your BeagleBone Black password when prompted):
40 6 Andrew McPherson
<pre>
41 6 Andrew McPherson
scp BeagleRT root@192.168.7.2:~/beaglert/
42 6 Andrew McPherson
</pre>