Cross compile for ARM, TS-7500 board

The TS-7500 single board computer from Technologic Systems is one of a family of boards based on the  Cavium ARM processor. The board runs a standard Debian Linux system from an SD card, useful for development, and alternatively a uClibc/Busybox system from flash for the  production phase (boots in less than 3 sec). Programs for the Debian system can be compiled on board, but that is a somewhat slow experience. So except for small test programs one will want to cross compile using a Linux work station.

Cross compilers can be downloaded from the ts7500 ftp site, There is one which links with uClibc and several that link with glibc. The former will run under both the Debian and uClibc system, the latter only under the Debian installation. Download and extract compilers, I extracted them under /usr/local/ts7500, providing two directory trees: arm-uclibc-3.4.6  and arm-unknown-linux-gnu

To compile for the uClibc system, use these compiler and linker flags (taken form the sample code‘s Makefile:

TOOLPATH=/usr/local/ts7500/arm-uclibc-3.4.6/bin/arm-linux-uclibc-
CC=$(TOOLPATH)gcc
STRIP=$(TOOLPATH)strip
LDFLAGS=-Wl,--rpath,/slib -Wl,-dynamic-linker,/slib/ld-uClibc.so.0
CFLAGS=-march=armv4 -Os

To test the tool chain, download the sample code tree and edit the Makefile tool chain path to reflect your compiler installation. Run make ts7500ctl and copy the ts7500ctl file over to the board. The program should be executable (./ts7500ctl –help) and ldd ts7500ctl should only point to the /slib library directory

libgcc_s.so.1 => /slib/libgcc_s.so.1 (0x4000d000)
libc.so.0 => /slib/libc.so.0 (0x4001e000)
ld-uClibc.so.0 => /slib/ld-uClibc.so.0 (0x40000000)

The uClibc library has evolved to a state where it may be linked to most programs. If you want to compile Debian source you may however use the glibc cross compilers. In this case you don’t need the linker flags and may compile like this:

/usr/local/ts7500/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-gcc \
            ts7500ctl.c ispvm.c -ots7500ctlglib

We now get these library references

ldd ./ts7500ctlglib
        libc.so.6 => /lib/libc.so.6 (0x40026000)
        /lib/ld-linux.so.2 (0x40000000)

1 Response to “Cross compile for ARM, TS-7500 board”


Leave a Reply