Remote C / C++ development on the Beagleboard using NetBeans IDE

After battling with cross-compiling C++ code for the Beagleboard using Eclipse on a Linux box, I've found a much easier way with the NetBeans IDE. You can edit and debug code on your computer of choice (I've tested with Mac and Windows) while the code compiles and runs on the Beagleboard itself:

Beagleboard development in NetBeansBeagleboard development in NetBeans

On the Beagle side of things, you need to install a few packages using "opkg install":

  • bash
  • task-nativ-sdk
  • gdb
  • samba

Samba is used to map the Beagle's filesystem onto the other computer. I've mapped the entire filesystem "/" to a share called "root" which is mapped onto my mac at "/Volumes/root". Configuration in NetBeans is fairly straightforward:

Open the NetBeans preferences (command + , on Mac) and click the "C/C++" tab, then the "Build Tools" sub-tab, then click the "Edit" button on the right:

Click "Add" to add a new development host. Enter the hostname (or ip address) of your Beagleboard and Click Next:

Enter your login details for the Beagle and click Next. NetBeans will then connect by SSH to the Beagle and run a script to find the development tools (GCC compiler, linker, make etc):

Click "Next" then ensure that "File system sharing" is selected under "Synchronization" and click "Finish":

Now click "Path Mapper" and enter the local path (where NetBeans can see the Beagle filesystem) and remote path ("/" if you have shared the entire filesystem:

With the new development host configured, NetBeans code highlighting needs some help to find the source code. Click the "Code Assistance" sub-tab, then the "C Compiler" or "C++ Compiler" button depending on what code you're writing. Delete all of the listed include directories, then click "Add" and add the appropriate ones for the Beagle:

Now you can create a project and start coding! After creating the project, there are a few project options that need to be set (File->Project properties). Under the "Build" category, "Development host" will need to be set to the Beagle:

You may also need to set include directories for the compiler (these should be the same as those set for Code Assistance).

With everything configured, NetBeans is a great IDE for development, with Debugging features, performance monitoring and advanced editing that make development much faster than using a simple editor on the Beagle itself.

User login