Complete Communications Engineering

When a new embedded device is designed and manufactured, it must eventually be loaded with software.  Since the new embedded device does not usually come with any software, the initial software must be built on a separate machine, so cross-compiling is necessary.  Cross-compiling is the process of building software for a specific device running a certain CPU architecture on a different machine that may have a different architecture (the build host).  The most common scenario is building software for embedded devices on PCs.  Another reason for cross-compiling is that embedded processors are usually not very fast, but they are expected to run full Linux systems with many programs.  While modern embedded processors are capable of running those systems fairly well, they may run into trouble trying to build them.  In some cases, a pre-built Linux system image is available and usable as-is.  In other cases, it is necessary and/or desirable to build the entire Linux system image from source code and cross-compiling will almost always be used for this.

In general, cross-compiling a complete Linux system involves the following steps:

  1. Decide on which cross-compiler to use and get it installed on the build host.
  2. Download the source code for all of the software required to run on the embedded device. This usually includes the Linux kernel and a boot loader.
  3. Configure and build all of the software. Keep track of the kernel and boot loader images, and install all of the user-space software to a staging folder somewhere on the build host.
  4. Generate a filesystem image from the staging folder.
  5. Load all of the software images onto the embedded device and power it on.
  6. In most cases it will not work, so troubleshooting and bug fixing is required.
  7. With enough perseverance, it can be made to work.

There are a number of Linux build systems available that can assist with most of these steps.  Two of these systems are Buildroot and Yocto.  Using a Linux build system is recommended for most embedded Linux projects.

Overview of Linux System Building using Cross-Compiling