ARM setup: How to load from flash?
Grant Edwards
grante@visi.com
Fri Mar 12 16:48:00 GMT 2004
> I'm also wondering how other people handle applications that will be
> stored on a flash, i.e. how they are linked, how data is moved to RAM
> etc. That's still for a standalone (no OS) arm-coff application with no
> and debug monitor support. Some questions:
>
> 1. Should I use a separate "loader" program, or have the app do the
> load itself?
Either one. I've done both in the past. If you've got plenty
of flash, I'd lean towards the separate loader program -- IMO
it's easier to maintain things that way, and I think it's
easier to disaster-recovery stuff into the loader.
> 2. Do I need to move the entire program, or just the data section?
It depends. I've done it both ways in the past. Running with
text/const in ROM is convenient, but often slow. On some
platforms RAM is much, much faster than flash ROM.
> 3. How can I override the default "start" behaviour (if that's what I
> want)? I tried specifying an alternative entry-point via the
> linker script, but the start code from crt0.S would still end up
> first in the output file (at least, it has the lowest address in
> disassembly output.)
Tell gcc you don't want start files linked in. IIRC, it's
-nostartfiles.
> 4. What does "entry point" in the context of linker scripts/linker
> options mean anyway?
It set's the "entry point" field in the ojbect file. This is
used by things like gdb (set's the initial PC value) and
objcopy sets the "entry-point" record in hex files .
> Does the COFF format know of such a concept,
Yes. So do ELF and most hex file formats.
> or will it just execute the first instruction found in the file?
Depends. To what does "it" refer to your question?
Here's a question for you:
Why are you using COFF instead of ELF?
--
Grant Edwards
grante@visi.com
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list