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.
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.
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.
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:
- Point compiler to the angstrom-arm-g++ in /usr/local/angstrom/arm….etc
- Point to angstrom-arm-assembler
- Use ARM gdb (included above)
- 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:
- echo . /usr/local/angstrom/arm/environment-step > env.txt
- echo $PATH >>env.txt
- 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
- 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.
- opkg update
- opkg install qt4-embedded –force-depends
- 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.
Github was used for version control. We setup a standard repository that can be found here:
We were unable to get ARM-gdb running because of some python support issues. If anyone has insight into this, let us know.