UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer busy_bri
Observer
8,757 Views
Registered: ‎04-28-2016

Multiple Applications/elf in single Boot.bin

Hi All,

 

I'm trying to prove that I can run two (or more) Bare-metal applications or elf files from a single Boot.bin without U-boot/Linux.

I want to run these applications consecutively on one processor. The Boot.bin file is as follows:

fsbl.elf

system_wrapper.bit

Hello_world.elf

Goodbye_world.elf

 

At first FSBL was overwriting Hello_World with Goodbye_world but I (Kind of) fixed this by editing the linker script files (lscript.ld). You'd think there would be a warning of some kind when two applications share the same address. Perhaps it was the order I created the Apps? 

The question I have is the hand-off process from one application to the next, FSBL does this with assembly and with my un-trained software eye it looks like a "goto" statement. Do i need my Hello_world application use this (forbidden) command, or is there another (hopefully easier) way?

0 Kudos
4 Replies
Highlighted
Participant pete_128
Participant
8,730 Views
Registered: ‎04-02-2016

Re: Multiple Applications/elf in single Boot.bin

Bootloaders are generally non-returning. This means that they also cannot boot multiple softwares. If you also want your Hello_world to be non-returning then you can do the same handoff technique to the next elf. Goto is simply sometimes the right tool for the job.

 

If you wanted the return to Hello_world.elf after Goodbye_world, then you would need to have Goodbye_world's entry point follow the calling convention and return. Then hello_world would be able to do the handoff as a function call.

 

The goto things is probably easier.

 

HTH

Observer busy_bri
Observer
8,484 Views
Registered: ‎04-28-2016

Re: Multiple Applications/elf in single Boot.bin

Thanks for the reply,

 

I had to bite the bullet and use a goto command which worked. I was able to jump from Application/elf to Application/elf. I was even able to jump back to fsbl (0x0000_0000). This worked great until I began adding code to the Goodbye_world.elf. The Start Address shifted!

I spent two days searching FSBL for some sort of algorithm that changes the start address (Like a size dependency or something). It turns out it was the .elf itself during a build!

I spilt my DDR memory in lscript.ld into 0x0010_0000 to 0x0FF0_0000 for Hello_world and 0x0FF0_0001 to 0x1FF0_0000 for Goodbye_world. Initialy 0x0FF0_0004 was the start address, as long as the start address was in 0x4 block multiple it would work (Start Address: 0x0FF0_0004 or 0x0FF0_0008 or 0x0FF0_000C...) when I began adding code to Goodbye_world the block range went up to 0x40. (Address: 0x0FF0_0040 or 0x0FF0_0080 or 0x0FF0_00C0).

I'm still not entirely sure why the address range increased from 0x4 to 0x40 but I believe it’s something to do with RAM block size....maybe.

Tags (3)
0 Kudos
Observer amitcrathod
Observer
3,548 Views
Registered: ‎02-23-2009

Re: Multiple Applications/elf in single Boot.bin

Hi busy_bri!

I am trying to run multiple application with same boot.bin file. Can you suggest me the exact procedure how can I make it?

Thanks in advanced!

0 Kudos
Observer busy_bri
Observer
3,509 Views
Registered: ‎04-28-2016

Re: Multiple Applications/elf in single Boot.bin

Hi amitcrathod,

 

its been almost a year since I gave up on a standalone design and moved on to an Linux design, but I do remember you need to partition your apps and "fiddle" with the lscript.ld file's Stack/Heap size and make sure the memory regions don't overlap. Sorry I cant provide anymore help.

0 Kudos