PowerPC and application in external RAM

May 13, 2005 3 Replies

Hi,



I have made a bootloader which runs from BRAM on a PPC. Now I want to download an application into external RAM and execute it. If I build my application and convert the .elf file into a binary file, the result is a 2 GB binairy file. This is because my external RAM starts at 0x80000000 and the startup up code contains a section called boot0, which is laid at



0xFFFFFFDC.

AFAIK, the boot0 section contains a jump to my application (0x80000000). But, I think, the boot0 section is not needed. At startup the boot0 section (in BRAM) contains a jump to my bootloader program and I don't want to overwrite it. How can I create a .elf file (or .bin file) without the boot0 section (but with initialisation/startup code)? In that case I can simply download my application through the bootloader into external RAM and jump to it.



TIA, Frank


Frank,

you have two options when you compile your application to reduce the address range it spans ("its size"):

- write your own linker script. In that linker script map the .boot and the .boot0 sections with the .text sections to the location of your external memory

- use "-Wl,--section-start,.boot0=" as a compiler option to map the .boot0 section to your desired location. For example in XPS set the start address of your application to 0x10 and use "-Wl,--section-start,.boot0=0" if your external memory is mapped to address zero.

- Peter

Frank van Eijkelenburg wrote:

Use "-Wl,--section-start,.boot0=0x80000000" and start address 0x80000010 for your environment.

A third option: strip the .boot and .boot0 sections from the ELF file as they provide the means to jump anywhere in the 4GB address range, something you do not need in your case because you have your own bootloader. Example: $ powerpc-eabi-objcopy -R .boot -R .boot0 original.elf new.elf

- Peter

Peter Ryser wrote:

Thanks for your suggestions,

I have used the option to strip the sections from the .elf file and it worked fine.

Frank

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required