cross compiling for embedded ARM

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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

Re: cross compiling for embedded ARM
Jeff:

Try http://able.sharpsma.com

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

Quoted text here. Click to load it



Re: cross compiling for embedded ARM
Quoted text here. Click to load it

for a very good introduction into cross compiling, see Bill Gatliff's
article at http://www.billgatliff.com/articles/gnu/gnu-arm7t.html/index.html
, also have a general look around his web-site.

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

Regards
Simon



Re: cross compiling for embedded ARM

Quoted text here. Click to load it

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




Site Timeline