SAM9-L9260 and CodeSourcery toolchain

Hi,

I recently picked up one of these boards since it was running uClinux, thought it might be nice to learn while working in a somewhat familiar environment.

I am no Linux guru, but I do use Linux.

Anyway, my problem is that I installed the CodeSourcery toolchain on my Fedora 10 box and followed the “getting started” html doc in the Sourcer_G++_Lite_for_ARM_uClinux directory.

As per the guide I created main.c file with a tiny program to print out some factorials.

I compiled per the instructions and was rewarded with a binary file ‘factorial’ and a ‘factorial.gdb’ file.

I placed the files in my web root folder of the web server running on my fedora box and used wget to download them to the L9260.

Once on the mcu I attempt to execute the binary file via “./factorial” and received the message “cannot execute binary file”.

I chmod to 777 to make sure there was no permission problems and keep getting the same result.

I also attempted to execute the .gdb file and get a segmentation fault.

All commands were done as root.

I also tried compiling with GCC and G++, getting the same results no matter what I do.

I am pretty bummed I can’t even get the simplest program to execute and can find no clues what to do next, I simply have not idea what I am doing wrong.

If anyone has a clue you could throw my way, or give me a nudge in the right direction I would really appreciate it.

Thank you.

EDIT:

Here is the example factorial program:

#include <stdio.h>
int factorial(int n) {
if (n == 0)
return 1;
return n * factorial (n - 1);
}
int main () {
int i;
int n;
for (i = 0; i < 10; ++i) {
n = factorial (i);
printf ("factorial(%d) = %d\n", i, n);
}
return 0;
}

Maybe you need the Linux toolchain, and not the uClinux one?

The SAM9260 runs a full Linux suite, not uClinux.

Check out Angstrom OpenEmbedded for an up to date method of building packages and kernels.

Wow, I had never heard of uCLinux until I found this board at Olimex.com, but sure enough everywhere I look it says Linux 2.6 complete, can’t find any reference to uCLinux, don’t know why I was absolutely certain that this board had uCLinux on it.

That should clear up all of my problems, thank you!!!

UPDATE: YAY!!! it works, got the arm-2007q1 from that OpenEmbedded site, compiled a simple hello world and it runs on my MCU =)~~~~~

Just as exciting as it was to get my first LED blinking on my breadboard with the atmega168.