LTIB and Qt on i.MX51

Published on November 3, 2010

Archived Notice

This article has been archived and may contain broken links, photos and out-of-date information. If you have any questions, please Contact Us.

Many thanks to the team at imxdev.org. Their notes on cross-compilation of Qt helped us greatly in walking through the process of getting Qt up and running on our Nitrogen i.MX51 board under LTIB.

We recently followed those directions to cross-compile Qt. The following are notes about places we deviated from the notes on the imxdev site and first impressions.

To begin with, we started with the qt-everywhere-opensource-src-4.6.3 release from Nokia and are testing against the 2010-07 kernel from Freescale as patched in our boundary20100804 branch.

Host tools

Compilation of the host-side tools went exactly as described in the imxdev.org notes, although we chose not to bother with a skin.

Target compilation

After setting the PATH and symlinking the LTIB directory into /tftpboot/ltib and grabbing the specs package for linux-mxc-g++, the imxdev.org page says to do the following:

user@host:~/qt-everywhere-opensource-src-4.6.3$ ./configure -embedded arm -xplatform qws/linux-mxc-g++ -release -prefix /usr/local/Trolltech/Qt-target-version -qt-gfx-linuxfb -qt-kbd-tty -qt-mouse-tslib -opengl es2 -little-endian -host-little-endian user@host:~/qt-everywhere-opensource-src-4.6.3$ make user@host:~/qt-everywhere-opensource-src-4.6.3$ sudo make install

We had a little trouble in each stage:

  1. The OpenGL libraries appear to have different names
  2. Additional libraries libpng, libz, and libjpeg appear to be needed for this combination of target and Qt
  3. The install process appears to be losing the PATH environment variable
  4. We chose to install directly to our root filesystem instead of the two-step install and copy scheme described on the imxdev page
  5. OpenGL support didn't work for us

The first two items required updates to qt-everywhere-opensource-src-4.6.3/mkspecs/qws/linux-mxc-g++/qmake.conf. Since we didn't create a git-repository before starting, we'll just place our updated file on on our web-site for now.

We received error messages during make install step, saying that "arm-none-linux-gnueabi-ranlib" and "arm-none-linux-gnueabi-strip" weren't found, even though they were in our PATH. We worked around this by editing qmake.conf to include the fully-specified path to each of the tools.

After the make install step, we discovered something that isn't said explicitly on the imxdev page:  make install will copy the ARM binaries to /usr/local/Trolltech where they'll be intermingled with the host's binaries compiled in an earlier step. The next step on the imxdev page (cp -a) will then copy nearly 1GB to the device's filesystem.

Instead, we chose to use the INSTALL_ROOT variable to install directly to the LTIB root filesystem, which resulted in a footprint of only 81MB.

user@host:~/qt-everywhere-opensource-src-4.6.3$ sudo make INSTALL_ROOT=~/ltib/rootfs/ install user@host:~/qt-everywhere-opensource-src-4.6.3$ du -hs ~/ltib/rootfs/usr/local/Trolltech 924M /usr/local/Trolltech/ user@host:~/qt-everywhere-opensource-src-4.6.3$ du -hs ~/ltib/rootfs/usr/local/Trolltech 95M /home/ericn/ltib/rootfs/usr/local/Trolltech/

At this stage, we were able to run the Qt demos, but not well. Some examples such as examples/qws/framebuffer/framebuffer worked properly, but most of the programs resulted in black or distorted on-screen areas.

We haven't dug into the problems in detail, but the problems disappear if we tell Qt not to use OpenGL:

user@host:~/qt-everywhere-opensource-src-4.6.3$ ./configure -embedded arm -xplatform qws/linux-mxc-g++ -release -prefix /usr/local/Trolltech/Qt-4.6.3/ -qt-gfx-linuxfb -qt-kbd-tty -qt-mouse-tslib -no-opengl -little-endian -host-little-endian -depths 16 -v

We'll spend more time exploring Qt in the near future, but with this small amount of effort, we've been able to get a full-fledged browser onto our machine with a pretty small footprint.

This is no small feat. Kudos to the Trolltech/Nokia folks!