cross compiling for embedded ARM

I've got the arm-linux-gcc cross compiler and am trying to write some small programs for a Cogent CSB335 ARM-based board. I wrote a simple program to poll the switches and blink the LEDs, naming the main routine _start so that the linker wouldn't complain. I compiled it with the following:

arm-linux-gcc -o blink --static -nostdlib -O0 blink.c

and it went through with no complaints. However, when I download the executable to the board and try to run it, I get the message "memory failure" and nothing else.

I seem to recall that you are supposed to be able to build stand-alone executables, but I haven't found a compiler or linker switch to do this. Does anyone have any pointer's as to what I'm missing?

thanks.

-- Jeff Dutky

Reply to
Jeffrey Dutky
Loading thread data ...

Jeff:

Try

formatting link

You will have to register first, but once your in, download software for the LH79520. They have builds that are targeted for a different board, but will work with the GCC tools.

-ZO

Reply to
ZO

for a very good introduction into cross compiling, see Bill Gatliff's article at

formatting link
, also have a general look around his web-site.

there is also a mailing list - cross-gcc - that may answer your questions...

Regards Simon

Reply to
Simon Berry

You need two things in addition to what you've done:

- The linker must be instructed to locate the memory sections according to the hardware layout. This needs a tailored linker script instead of the standard one.

- There has to be the initialisation code needed by the program pieces being run. In embedded systems, the initialisation of the .data section has to be handled. This may also necessitate changes in the linker script to locate the .data addresses to RAM but the contents into a ROM copy.

HTH

Tauno Voipio tauno voipio @ iki fi

Reply to
Tauno Voipio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.