SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By jessexm
#58439
Hello All,

I'm having trouble building a hello world application for an Olimex SAM9-L9260 board.

The application seems to cross compiles just fine, but when I execute it on the SAM9 I either get:
" No such file or directory" error when the application is built with dynamic libs
or
"Illegal instruction" error when the application is built with static libs.

The results are the same if I use the gcc tools supplied on the CD from Olimex or the latest free tools from CodeSourcery.

I have not modified the kernel or file system, it's brand new out of the box.

One thing of note is that the applications in the files system have the following signature when file is run on them:
wget: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped

Where my executable has:
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped

The differences being (ARM) vs (SYSV), Linux 2.4.1 vs Linux 2.6.14, and stripped vs not stripped. Other than the static or shared libraries I do not know how to effect the above differences.

I have seen others ask about this problem but do not see any solutions. Any help would be appreciated.

Thanks,
Jesse
By dimitar
#59304
Hi,

The kernel is built with a codesourcery toolchain - you can see that from the kernel messages during booting. The problem is that the kernel has no activated support for the new ARM EABI. The utilities on the SAM9-L9260 filesystem are old-ABI ELF binaries. But codesourcery toolchains produce EABI binaries which are incompatible with the default kernel image on SAM9-L9260.

You can resolve that in two ways. First, you can activate support for the new EABI in kernel, recompile it, and use your user application without modifications. Ensure that the following two kernel options are both set to "y":
Code: Select all
CONFIG_AEABI=y
CONFIG_OABI_COMPAT=y
The first one activates support the new EABI binaries, and the second one activates support for legacy old-EABI binaries (such as the utilites on the SAM9-L9260 filesystem). Recompile the kernel and flash the new image using the SAM-BA script on the CD.

The second option is to use an old-ABI toolchain to build your hello-world binary. One such toolchain can be downloaded from here: http://arm.cirrus.com/files/tools/arm-l ... 0t.tar.bz2

In any case you should compile static applications to avoid shared library version problems.

You can learn more about old-ABI and EABI from the following resource: http://wiki.debian.org/ArmEabiPort

Regards,
Dimitar
By jessexm
#59530
Thanks for the information.

I rebuilt the kernel with the options you specified and now I can execute my application.

Earlier I reported that the ethernet interface was not working. Well it turns out that the ethernet interface is now eth2. I believe it is eth0 in the original kernel.

Thanks again,
Jesse
By pawel
#65485
Hi,

Can you please give some clues how to rebuild the kernel. Maybe some link to tutorial or manual.

Thanks,
Paul
By brian111
#117838
Hey, this is good that you got your application working. But can you give some tips for building the kernel. I am looking forward to getting some very useful links as someone above has asked it over here. I hope that someone will help us so that we can learn a bit more about it.