The BeagleBone Black - A Low-Cost Embedded Platform

The BeagleBone Black - A Low-Cost Embedded Platform, Part 3

By Jeff Tranter

In part one of this series I introduced the BeagleBone Black, a low-cost embedded computer platform that supports Qt. In part two, we looked at how to get Qt 4 up and running on this platform. In this installment, we'll look at how to get the latest release of Qt, Qt 5, running on the BeagleBone Black.

As with Qt 4, we can choose from several approaches.

Pre-Built Packages

Pre-built Qt 5 binary packages are available for Ubuntu. The top-level package is called "qt5-default" and can be installed with apt-get. It uses X11, so you will need an X server and an X11-based desktop installed. As on Ubuntu on desktops, there are several desktops to choose from including KDE, Gnome and LXDE. You will need a filesystem on your micro-SD card that is large enough to install the packages.

Pre-built Qt 5 packages are not yet available for the Ångström Linux distribution.

Build Natively

You can build Qt 5 natively on the BeagleBone by following a similar process to the one for building Qt 4, as described in part two of this blog series. It is built similar to any other desktop system. A full build will take over 24 hours, so cross-compilation is generally a better option.

Cross-Compile on a Desktop Computer

We covered OpenEmbedded in part two. There are OpenEmbedded BitBake recipes available for Qt 5. They are still in development and not yet part of official releases but are suitable for test purposes.

The most official version is maintained at this site (1) although you may find others (2). Here are quick instructions for cross-compiling Qt 5 on a desktop Linux system with these recipes. First, run the following commands:

git clone git://github.com/Angstrom-distribution/setup-scripts.git
cd setup-scripts
MACHINE=beagleboard ./oebb.sh config beagleboard
cd sources
git clone https://github.com/meta-qt5/meta-qt5.git
cd ..

This gets the standard Ångström Linux OpenEmbedded package and adds the layer for the Qt 5 recipes. Now edit the file conf/bblayers.conf to add the meta-qt5 layer to BASELAYERS, by applying the following patch, which adds one line to the file:

diff --git a/conf/bblayers.conf b/conf/bblayers.conf
index 57606f6..ccc8ab2 100644
--- a/conf/bblayers.conf
+++ b/conf/bblayers.conf
@@ -30,6 +30,7 @@ BASELAYERS ?= " \
   ${TOPDIR}/sources/meta-qt5 \
   ${TOPDIR}/sources/meta-openembedded/meta-systemd \
   ${TOPDIR}/sources/meta-ros \
+  ${TOPDIR}/sources/meta-qt5 \
   ${TOPDIR}/sources/meta-beagleboard/meta-beagleboard-extras \
 "

Now update and build the top-level recipe using BitBake:

MACHINE=beagleboard ./oebb.sh update
MACHINE=beagleboard ./oebb.sh bitbake qtbase

This will take some time. After the build completes, you should have just over a dozen Qt 5 packages in the directory setup-scripts/deploy/eglibc/ipk/armv7ahf-vfp-neon. A typical package file is qtbase_5.1.1-r0.0_armv7ahf-vfp-neon.ipk. These can be copied to the BeagleBone Black and installed using the opkg command.

If desired, you can build packages for additional Qt modules such as Qt3D, QtDeclarative, QtMultimedia and QtWebkit.

The current Qt 5 BitBake recipes are still in development and have a number of known issues and limitations. They may not even build on a given day, but at the current time, people are working on improvements. I recommend you follow the Qt Interest mailing list (4) to monitor progress.

Recently, Digia announced that the latest version of Qt Enterprise Embedded, its commercial version of Qt for embedded devices, now supports the BeagleBone Black as a reference device for both embedded Linux and embedded Android (3).

Summary

We've only covered the basics of using OpenEmbedded to build Qt 4 and Qt 5. The sites referenced here and in the previous blog posts have more information. The annual Qt Developer Days conferences in Europe and North America are also a good opportunity to learn more about Qt in general and on embedded systems specifically.

References

  1. github.com/meta-qt5/meta-qt5, Qt 5 OpenEmbedded layer, git code repository
  2. gpupowered.org/node/20, Qt5 (minimal) on BeagleBone with Yocto, blog post
  3. blog.qt.digia.com/blog/2014/02/25/major-update-to-qt-enterprise-embedded-released, Major Update to Qt Enterprise Embedded Released, blog post
  4. lists.qt-project.org/mailman/listinfo/interest, Qt Interest, mailing list