75XX Cross Compiling

From embeddedTS Manuals
Revision as of 22:00, 27 July 2011 by Mark (talk | contribs) (Created page with "If your sources are large enough that compiling on the board is too encumbering, we provide toolchains that you can use from another Linux or Cygwin environment. For this board ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

If your sources are large enough that compiling on the board is too encumbering, we provide toolchains that you can use from another Linux or Cygwin environment.

For this board you will want to use this toolchain. Extract it to the root of your filesystem, and run that version of gcc to prepare the ARM binary.

To Compile:

[user@localhost]$ /usr/local/arm-oabi-toolchain/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-gcc hello.c -o hello
[user@localhost]$ file hello
hello: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), for GNU/Linux 2.6.26, not stripped

Transfer the file to the board (scp, nfs, smb, etc) and execute it:

ts7500:~# ./hello 
Hello world!

When compiling for c++, you must add in the compile option '-mhard-float'. This will make floating point operations throw an exception to the kernel which will properly handle the floating operations in a software FPU. Compiling without this option will result in a floating point error.

If you receive an error in a natively compiled application containing ILLEGAL INSTRUCTION, remove '-mcpu=arm9' if you have it and use '-mcpu=arm7'. Even though this is an ARM9 CPU, gcc will sometimes generate instructions that aren't covered by arm9 itself (like thumb instructions even when specifying -mno-thumb-interwork).