Wiesemann & Theis GmbH

Networking, sensors and interface technology for industry, office and IT

Application for pure.box:

Install the cross-compiler on a Linux system

How to install the cross compiler on a Linux system for translating C/C++ source texts into executable program files for the target system of the pure.box:

To create your own C/C++ programs for the pure.box you need a cross compiler which translates the source text into a machine code which can be executed by the target system. This cross compiler can be installed on a Linux guest system in just a few steps.

In the simplest situations the cross compiler can be opened using the command line of the guest system to create binaries for the pure.box. Integration into more complex development environments such as Eclipse is also easily possible.

Depending on the model of the pure.box and the firmware installed on it, various versions of the cross compiler can be used. The pure.box 3 and pure.box 5 (up to firmware 1.38) run on uCLib. For firmware versions 1.39 and higher the pure.box 5 uses GLib. Both versions of the cross compiler cannot run in parallel on the same guest system!

The following example shows step-by-step how the cross-compiler is installed. The guest system used here is a current Ubuntu (64-bit). In general this procedure can be used on any 64-bit Linux system.

  • Download the W&T cross compiler compatible with your pure.box..

  • Open a terminal with normal user rights and switch to the directory where the downloaded cross compiler is located.

    Use the command shown at right to make the file executable.

    pure.box 3 and pure.box 5 (up to firmware 1.38)
    chmod +x e-50511-01-swww-009.sh

    pure.box 5 (firmware 1.39 and higher)
    chmod +x e-50525-02-swww-000.sh

  • Start the installation and follow the instructions in the terminal (command at right)

    NOTE: The root password is required for this procedure!

    pure.box 3 and pure.box 5 (up to firmware 1.38)

    pure.box 5 (firmware 1.39 and higher)

  • To compile a simple program using the program line, the adjacent command is required.

    arm-linux-gcc opens the compiler which the machine code creates.

    The option -I tells the compiler where to find the Include files needed for the pure.box.

    -o defines the program file you are creating.

    The file path (here: main.c) references the source text to be translated.

    Finally information about the process architecture of the target system is still needed.

    pure.box 3:
    arm-linux-gcc -I /usr/local/arm-pkg.armv5te/usr/include/ -o hello_world main.c -mcpu=xscale

    pure.box 5:
    arm-linux-gcc -I /usr/local/arm-pkg.armv7hl/usr/include/ -o hello_world main.c -mtune=marvell-pj4 -march=armv7-a -mfloat-abi=softfp