Setting Up Development For The BeagleBone Black in Ubuntu

Hello, and welcome to this tutorial! Here, you will encounter a series of general instructions for enabling yourself to program the BeagleBone Black board from Ubuntu using the Eclipse Integrated Development Environment, the Eclipse C++ Development Tools and the Angstrom Distribution Toolchain, all which are available free of charge thanks to our open source community.


Part 1: Downloading and Installing Components

Part 2: Configuring the Development Environment

Part 3: A Simple Example

Materials Needed

1x BeagleBone Black

1x Computer

1x Set of eyeballs

1x Very smart brain

1. Let's Get The Parts

a. Install Eclipse

Open up the Ubuntu Dash bar and type in “Ubuntu Software Center” and click on the icon as it looks above.

Type “eclipse” into the top right hand side search box. And install the Eclipse IDE by clicking “Install”.

b. Install Eclipse C++ Development Tools

Type “eclipse-cdt” into the searchbox and click the “Install” button for the “C/C++ Development Tools for Eclipse” package.

OK, so now you have successfully installed Eclipse and the C/C++ Dev Tools, now we need to download the toolchain that will allow us to compile C/C++ programs in Ubuntu, that can actually execute in the Angstrom Distribution natively.

c. Download And Install The Angstrom Distribution Toolchain

For this step, take note wether you have a 64bit or 32bit version of Ubuntu. If you have 32bit, then pick a package with “i686” somewhere in the name, but if you have a 64bit version, you must find one with “X86_64” somewhere in the name.

Navigate to and download the package that matches your version of Ubuntu as described before to the location of your choosing, take note of the directory where the file was downloaded to so we can install it next.

Open up a terminal window by clicking on the Dash menu button and typing in “terminal” click the terminal icon as above.

Now we have to navigate to the folder containing the toolchain from the terminal. You can do it by simply typing “cd PATH” where PATH is the path to the toolchain from the previous step as shown above. In our case, we use the default Downloads folder for Ubuntu.

Type “ls” and hit enter, and a list of all the files in your download folder will come up. You want to use your mouse and copy the name of the toolchain package you just downloaded. As in my case i'ts the file name in red above. The red means it's read-only

you can make it readable by typing “chmod +rwx FILENAME” where “FILENAME” is the angstrom toolchain package name in red and hitting enter. Then you can type “ls” and the file will now be green

which means it's readable.

Now to install it, we have to decompress the archive by typing “tar -xjvf FILENAME” where “FILENAME” is the name in green from the previous step. Finally type “exit” and hit enter and the terminal will close.

Now we have the meat and bones of the development environment. Next we will focus on the configuration bit of the pie.

2. Configure The New Tools

a. Configure Eclipse's C++ Development Tools

Start Eclipse, which should be installed in your system, find it by the Ubuntu Dash as you did for the Ubuntu Software Center and the Terminal application.

Click on the "Help" main menu option click Install New Software from the options available

On the software sources dropdown menu, select the Helios source and the contents of the  listbox will change

Expland the "Programming Languages" category and checkmark the "C/C++ Development Tools" package, then click next. Accept the dialog and license agreement and you got the development tools, let's move on to the Angstrom toolchain setup.

b. Configure Eclipse to Use the Angstrom Toolchain

Start a new project by clicking File->New->Project

When the New Project dialog pops up, expand the "C/C++" category and select "C Project" on the list, then click Next.

Type in a name for your project, in this example we will do the infamous hello world. Then click "Finish"

Right click on the name of your project in the Project Explorer tab, select click on "Build Configurations" and select "Manage"

When the manage configurations dialog appeas, click New... to create a new configuration that we will use to cross compile for our Beagle Bone Black from our computer.

On the following dialog , type in the name of the configuration in the textbox labeled "Name". In this case "bb_debug" and click Ok.

Open up the project's properties by right clicking on the project name in the Project Explorer and selecting "Properties" at the bottom. Or, you can use the shortcut [Alt+Enter].

On the menu on the left, expand "C/C++ Build" and select "Settings". On the "Configuration" dropdown box, select the "bb_debug" that we created before.

Under the settings list, click on "GCC C Compiler" and enter "/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc" into the "Command" textbox. Now click on "Includes" in the Settings list.

On the "Include paths (-l)" list, the top one, add "/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include" as a directory path and click OK. Now click on the "Linker Settings" settings option.

Enter "/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc" in the textbox labeled "Command". Now click the "Libraries" option under GCC Linker.

Add the path "/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc" as a "Library seach path(-L)" entry on the bottom. Now click on GCC Assembler.

Enter "/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-as" into the "Command" textbox, click OK and we are done with the configuration.

Now we need to activate this configuration.

Right click on the project name in the Project Explorer, go down to "Build Configurations" and click on "Set Active". You should see the "bb_debug" configuration on the list. Select it. Now let's code.

3. Let's Bring It All Together

Now we have everything we need to compile native applications for the BeagleBone Black on Eclipse from our Ubuntu distribution on our computer. Let's do hello world.

Add a source file to the project by clicking on File->New->Source File

On the "New Source File" dialog enter "hello_world.c" as the name of the source file and click Finish.. 

On the code editor enter the following code.

//////////////////BBB HelloWorld GarageLab/////////////////////

#include <stdio.h>
int main()    
printf("Hello, world!, from GarageLab!\n");
return 0;

Save the file by clicking on File->Save or using the keyboard shortcut [Ctrl+S]

Now, all we have to do is build the project and transfer our executable to the BeagleBone Black.

When the compilation is complete, an executable called "hello_world" will be located in the "bb_debug" folder within 
your project's directory. For example the path to the location of your executable should look like
This is also the location of the Makefile. If there were any problems with the compilation, they will show up within
the "Problems" tab bellow the code editor.

Now that you have an executable, you can follow [LINK TO TRANSFER TUTORIAL HERE] link to
follow the instructions on loading transfering it to the BeagleBone Black.

Congratulations, you now have a rich programming environment for your BeagleBone Black, I hope this tutorial was
insightful and if you have any questions, comments or concerns I encourage you to leave your feedback bellow.


Views: 7144


You need to be a member of GarageLab (arduino, electronics, robotics, hacking) to add comments!

Join GarageLab (arduino, electronics, robotics, hacking)

Latest Activity

iftekhar Mobin is now a member of GarageLab (arduino, electronics, robotics, hacking)
Profile IconLeicester Hibbert and Michael Young joined GarageLab (arduino, electronics, robotics, hacking)
Jan 9
Profile IconThorsten Schwarz and Dana Custer joined GarageLab (arduino, electronics, robotics, hacking)
Jan 2
Aqeel munir updated their profile
Dec 31, 2016
Todd Enger updated their profile
Dec 29, 2016
FRANK KWABENA is now a member of GarageLab (arduino, electronics, robotics, hacking)
Dec 28, 2016
Ayhan Chaplan commented on GarageLab's blog post How to use a Peltier with Arduino
"Hi! Will this setup work with a 3,8V / 2,5A Peltier element? Or do I have to reduce the resistance…"
Dec 26, 2016
Profile IconAyhan Chaplan, Erva and Donna Carter joined GarageLab (arduino, electronics, robotics, hacking)
Dec 26, 2016
Galy Huang posted a discussion

Ubuntu on Firefly-RK3399

Firefly-RK3399 with dual-core Cortex-A72 and quad-core Cortex-A53, ARM® Mali-T860 MP4 quad-core…See More
Dec 20, 2016
Chase Rangel posted a discussion

What is the simplest way to control one brushless motor forward/reverse?

  Hello everyone I don't know much about this type of stuff had only a handful of RC cars.I've been…See More
Dec 12, 2016
Profile IconErving Howe, Chase Rangel, Werner Pretorius and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Dec 12, 2016
Frank Turner is now a member of GarageLab (arduino, electronics, robotics, hacking)
Dec 9, 2016
Marcelo Rodrigues and swapnil are now friends
Dec 6, 2016
Marcelo Rodrigues replied to swapnil's discussion Tiny 85 based Thermometer
"Dear Swapnil, Since you don't have any experience with programming you should consider start…"
Dec 5, 2016
swapnil posted a discussion

Tiny 85 based Thermometer

Hi, can any one guide me how to make the tiny 85 based Thermometer which will glow the LED…See More
Dec 4, 2016
Spyros Svoronos is now a member of GarageLab (arduino, electronics, robotics, hacking)
Dec 4, 2016
K Biju is now a member of GarageLab (arduino, electronics, robotics, hacking)
Nov 29, 2016
Profile Iconswapnil and Yasser joined GarageLab (arduino, electronics, robotics, hacking)
Nov 28, 2016
udit is now a member of GarageLab (arduino, electronics, robotics, hacking)
Nov 25, 2016
Aqeel munir is now a member of GarageLab (arduino, electronics, robotics, hacking)
Nov 23, 2016

© 2017   Created by Marcelo Rodrigues.   Powered by

Badges  |  Report an Issue  |  Terms of Service