Tag Archives: CrossCompile

Cross Compiling for Embedded Devices

I’ve learned a few things recently about cross-compilation for embedded devices. I think this will become more and more a hot topic because of the Internet of Things (IoT) is boosting through the charts and many people are jumping into that. Here are some of the lessons learned (not all). Let me know if you have more insights into this exciting topic.

The Qt IDE is a great open source tool for software development. What if it would also become a great tool for cross software development? This makes perfect sense because Qt has the only IDE that works on all platforms. This was the question that triggered my pursuit in making the Qt IDE work to cross compile software for ARM devices running linux. Here are some of the lessons learned (as of Aug 2014):

  1. The best I could do so far is to use the Qt IDE on Ubuntu (working as either on a virtual machine or a real boot) to cross compile the code for the ARM and automatically deploy it on the ARM device. I’ve used a standard Qt project and also Cmake, both work great. With Cmake there might be a few tweaks if you want to deploy only one program instead of the whole project. More on this latter. Use the toolchain from linaro.
  2. Use gdbserver to debug, on the Qt IDE you must use a gdb with python enabled. It’s not to hard to compile gdb with the python extension (most cross compiler toolkits available don’t have gdb with python enabled, let me know if you find one)
  3. Don’t try the Qt IDE  on Windows to cross compile. It’s possible but there is a lot of pain involved. This Qt bug report gives you a interesting  perspective of what’s going on. Just accept the fact that it’s best to cross compile from linux (x32,x64) to linux (arm) – for the moment, I think this will change soon. I will post some instructions on this latter. But if you really, really want to spear head this start by  downloading the toolchain for windows from Linaro or the Sourcery CodeBench toolchain and use Cmake instead of a Qt project.
  4. Eclipse seems to be more appropriate to use for the development of embedded applications (in either Windows and Linux) but Qt creator will also get there soon I think. But if you just want something working you are better off with Eclipse at this time.

Here are some links to help you set up

Qt Creator

Eclipse