Development Environment

Special thanks to TIers John Hutcherson and Janet Waugaman

Before any work could start on the project a viable development environment had to be created. A robust environment would serve as the foundation for the entire project. The environment would need to meet the below criteria:

  • Cross compile ARM binaries natively on x86 machines
  • Support Qt-4 (GUI development framework, more about this later)
  • Remote deploy and debug capability
  • Rich serial debug support
  • Rapid delployment
  • Source/revision control
  • low cost

Based off the aforementioned requirements, A rich tool-set was assembled. A Linux based OS was a natural fit because the target (Beaglebone Black) would be running Angstrom. This proposed an interesting challenge because the team only had Windows/OS X available. When became clear that virtualization would be necessary, the team turned to VirtualBox (https://www.virtualbox.org/wiki/VirtualBox). Ubuntu was selected because of it’s large base of support and available information. We found that the GNOME windowing environment was taxing our virtual systems greatly, so we moved to Lubuntu–a lightweight windowing alternative to GNOME. Let’s take a deeper look at the process for setting up the required environment.

GUI Framework

First step in building a GUI is deciding what framework to use, if one is necessary. We chose the Qt framework because of its easy to use API, lightweight build size, robust signal/slot event handler and the wealth of know-how that was available from TIers developing in Qt.

Qt_logo

The deploy everywhere step is critical. Not only is Qt compatible with many architectures, it is truly cross platform, meaning that the same source code can generate executable binaries for Linux, Windows, OS X, on a variety of architectures such as ARM and x86.

Cross Compiler

The BeagleBone (target) would be running Angstrom Linux on a Texas Instruments ARM Cortex A-8 (AM335X). However, our virtual environment was running Ubuntu Linux on virtualized x86 hardware. This means we would need to cross compile, or we would need to build natively on the BeagleBone. The approach of any scalable project such as this is to cross compile to lower compile time and increase ease of development, especially in the resource limited world of embedded Linux. Drawing off the hard work of programmers across the world (listed below), we built up our toolchain.

It seemed the site that hosted the compilers was down, so they can be found on Mier’s google drive. (https://googledrive.com/host/0B3Z340LOBulvMG5NRmNlZEppSEE)

Before we delve into the setup, lets talk about the anatomy of a compiler:

angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3
Angstrom signifies our target OS with date, linux is the OS type, armv7a is the target processor architecture, and gnueabi stands for GNU application binary interface. This means that we’ll be using the GNU set of compilers (g++) targeting Angstrom on an embedded ARM device. The last bit of information states that the compiler comes with Qt Embedded version 4.6.3 binaries included, all we would need to do is point our development environment to these libraries at compile time.
The rest of the environment setup is detailed by many blogs online and our approach was to use them as a guide.
IDE: Remote Deploy/Debug
Since we would be developing with C++ and Qt, Qt Creator seemed like a natural fit. We setup a BeaglePhone specific kit that was custom to our needs. The steps are outlined below as:
  1. Point compiler to the angstrom-arm-g++ in /usr/local/angstrom/arm….etc
  2. Point to angstrom-arm-assembler
  3. Use ARM gdb (included above)
  4. Setup beaglebone as generic linux device and IP of 192.168.7.2 (for remote deploy) (hint usr: root, pw: none)

A special note is that using the . /usr/local/angstrom/arm/environment-setup script only sets up the environment for the current terminal session. To set it up permanently in Qt Creator we followed the below steps:

  1. echo  . /usr/local/angstrom/arm/environment-step > env.txt
  2. echo $PATH >>env.txt
  3. Open Qt Creator -> projects -> select your kit -> environment variables -> use clean system environment -> batch edit -> paste the contents of the env.txt into the batch edit window
    1. Note that your path will be incorrect, so manually edit it and replace with the final line that you appended to env.txt in step 2

Now that desktop was setup, we moved to the BeagleBone.

  1. opkg update
  2. opkg install qt4-embedded –force-depends
  3. opkg install libqtcoree-dev libqtguie-dev

The force depends is required because of a kernel update that modifies some dependencies, for our testing the environment ran smoothly.

At this point we were ready to remote deploy, but we found that our LCD cape (listed under parts) wasn’t registering mouse clicks, we fixed this by issuing the following command

  • opkg install qt4-embedded-plugin-mousedriver-tslib

Serial Port Support

We initially tested with Serilib, an open source lightweight serial library, and while it was a great project, we found we wanted a little more. We moved to Qt yet again because it would fit well with the rest of our project. However, we found that native support required Qt5, and the QtSerialPort project depended on QElapsedTimer which wasn’t added until Qt4.8. Luckily QExtSerialPort was a legacy effort that worked quite nicely for us. We did have to make one small change on the BeagleBone to get it running.

  • ln -s  /lib/libudev.so.1 to /lib/libudev.so.0

With that we were ready to use serial communications.

Version Control

Github was used for version control. We setup a standard repository that can be found here:

https://github.com/seanmlyons22/BeaglePhone

Remote Debug

We were unable to get ARM-gdb running because of some python support issues. If anyone has insight into this, let us know.

 

One Comment on “Development Environment

  1. I strongly encourage you to re-direct this very interesting project to get the unique free/libre mobile phone in the world market (free in GNU sense: http://www.gnu.org/philosophy/free-sw.html ). To do this, it is necessary to ensure that all hardware has free/libre drivers / firmware ( http://libreplanet.org/wiki/Group:Hardware/Single_Board_Computers ) and publish all software developments with free/libre licenses ( http://www.gnu.org/licenses/licenses.html ). And change the base distribution (Ubuntu) to a free/libre distribution (Debian, gNewSense, Musix, Parabola,…). Best regards.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s