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: 
Visitor erickrieg
Visitor
5,286 Views
Registered: ‎09-22-2016

how to get an elf file to run autonomously?

There is a wonderful video that shows you how to compile a hello world and run it from a debugger or straight from the SDK.  I managed to get that much running the 2016.2 SDK on Windows.  What I have failed for days to do is get the created elf file to run from a command line interactive call - or better yet to be able to easily modify the contents of the SD card just just have my own little app get called on start up.   Presently, there are very complicated fast moving videos that tell you how to rebuild the kernal, U-boot or the linux that starts up on the card - my gut tells me I shouldn't have to rebuild the programmable logic an all those tools just to get a simple program of mine to run on it's own.   - thanks in advance anyone for getting me past this point.  Eric

0 Kudos
3 Replies
Teacher muzaffer
Teacher
5,265 Views
Registered: ‎03-31-2012

Re: how to get an elf file to run autonomously?

If you're talking about running a program automatically when linux boots, all you need is to add a line to /etc/rc.d/boot.local or /etc/rc.local. This means you need to rebuild the root file system after modifying the relevant file and adding your program to it.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor _bj_
Visitor
5,239 Views
Registered: ‎10-04-2016

Re: how to get an elf file to run autonomously?

I think you don't want to have a linux running on your board, only baremetal from your SD-Card.

 

Thats pretty easy. You need an FSBL und u-Boot on the SD-Card. Follow this tutorial or search around the internet. There are a lot solutions:

http://www.wiki.xilinx.com/Prepare+Boot+Medium

 

Maybe you have already a precompiled fsbl with uboot for an linux image. Thats the easiest way to start. Take the BOOT.bin (this is the fsbl + uboot) your bitstream file and the uEnv.txt (hope you have an example setup for this). There is also an linux image and the linux kernel in such an example. But you don't need it, you want baremetal only.

 

Copy this on your sd-card fat32 partition (should be the first one)

Next you need to modify the uEnv.txt. There you see how the linux kernel is booted. Replace the content with something like this:

 

 

uenvcmd=bootelf yourElfFile.elf

 

And thats it. It should boot yourElfFile.elf

 

Sorry if there is something wron, this was written óut of my head.

0 Kudos
Highlighted
Visitor _bj_
Visitor
5,081 Views
Registered: ‎10-04-2016

Re: how to get an elf file to run autonomously?

Sorry this commandline should look like this:

uenvcmd=fatload mmc 0  0x1000 yourElfFile.elf && bootelf 0x1000 
0 Kudos