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: 
Participant jimfred
Participant
13,582 Views
Registered: ‎10-31-2011

.bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

In the Vivado SDK, the 'Create Zynq Boot Image' menu uses a .bif file to create a .bin file. The .bif file has absolute paths, something like this...

 

the_ROM_image:
{
	[bootloader]D:\MyDir\project.sdk\fsbl\Debug\fsbl.elf
	D:\MyDir\project.sdk\hw_platform_0\top.bit
	D:\MyDir\project.sdk\MyApp\Debug\MyApp.elf
}

 

Is there a way to specify relative paths - relative to the project?

 

In TCL scripts, we use something like this to get relative paths...

# Get the project's directory and .bit file
set prjDir [get_property DIRECTORY [current_project]]
set bitFile $prjDir/[current_project].runs/impl_1/TOP.bit

 

I'd like to find a similar way to utilize relative paths in .bif files.

 

Edit:

found similar question here: http://forums.xilinx.com/t5/Embedded-Development-Tools/SDK-BootGen-Current-Directory/td-p/238446

 

8 Replies
Xilinx Employee
Xilinx Employee
13,569 Views
Registered: ‎07-23-2012

Re: .bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

You can do this by setting "Path Variables" in SDK.

Please go to SDK help for guidance on setting this up.
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
0 Kudos
Participant jimfred
Participant
13,565 Views
Registered: ‎10-31-2011

Re: .bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

Do you mean I'd reference a path variable in the .bif file? Something like...
[bootloader] ${PROJECT_LOC}\project.sdk\fsbl\Debug\fsbl.elf
0 Kudos
Highlighted
Participant jimfred
Participant
13,562 Views
Registered: ‎10-31-2011

Re: .bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

I tried referencing a path variable in the .bif file but it looks like .bif files don't de-reference path variables. Using the example above, WORKSPACE_LOC is defined as D:\MyDir\project.sdk. The .bif file can find D:\MyDir\project.sdk\fsbl\Debug\fsbl.elf but not ${WORKSPACE_LOC}\fsbl\Debug\fsbl.elf.

How would path variables help with .bif files?
0 Kudos
Observer dtrask
Observer
8,888 Views
Registered: ‎01-08-2014

Re: .bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

I have the same question as the original poster. Would you please answer his question at the end of this thread?

0 Kudos
Participant dave74321
Participant
7,021 Views
Registered: ‎09-29-2016

Re: .bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

I have the same question.  Does anyone have an answer yet?

0 Kudos
Moderator
Moderator
6,496 Views
Registered: ‎09-12-2007

Re: .bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

If you used a [glob -directory <path> uboot.elf] here would this resolve the path?
0 Kudos
Explorer
Explorer
4,100 Views
Registered: ‎04-23-2013

Re: .bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

I am also trying to use relative paths in a bif file, 2016.3

0 Kudos
Observer rothy18
Observer
1,464 Views
Registered: ‎11-12-2018

Re: .bif file to create Zynq boot image in SDK - with relative paths rather than absolute paths

I registered a post_build.bat in "C/C++ Build" -> Stettings -> "Build Steps (Tab)"
to recreate the bif file on every build.

post_build.bat
===============
echo //arch = zynq; split = false; format = BIN > ..\bootimage\app.bif
echo the_ROM_image: >> ..\bootimage\app.bif
echo { >> ..\bootimage\app.bif
echo     [bootloader]%cd%\..\..\fsbl\Debug\fsbl.elf >> ..\bootimage\app.bif
echo     %cd%\..\..\system_hw_platform_0\sw_model_top_wrapper.bit >> ..\bootimage\app.bif
echo     %cd%\app.elf >> ..\bootimage\app.bif
echo } >> ..\bootimage\app.bif

This results in a bif looking like

app.bif
=======
//arch = zynq; split = false; format = BIN
the_ROM_image:

{
    [bootloader]C:\PathToWorkspace\app\Debug\..\..\fsbl\Debug\fsbl.elf
    C:\PathToWorkspace\app\Debug\..\..\system_hw_platform_0\sw_model_top_wrapper.bit
    C:\PathToWorkspace\app\Debug\app.elf
}

It seems that relative "redirectors" (..\..) within an absolute path are allowed.

 

0 Kudos