cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Anonymous
Not applicable
14,026 Views

.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
Highlighted
Community Manager
Community Manager
14,013 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
Highlighted
Anonymous
Not applicable
14,009 Views

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
Anonymous
Not applicable
14,006 Views

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
Highlighted
Observer
Observer
9,332 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
Highlighted
Explorer
Explorer
7,465 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
Highlighted
Moderator
Moderator
6,940 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
Highlighted
Explorer
Explorer
4,544 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
Highlighted
Observer
Observer
1,908 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.