cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rdb9879
Explorer
Explorer
1,702 Views
Registered: ‎09-27-2013

petalinux on zynq: update *.bit file from Windows host

Jump to solution

Greetings,

 

We do most of our Vivado development on a Windows host. Right now, when we make a modification to the *.bit file, we have to generate a *.hdf file, transfer that to a linux machine, run petalinux-config --get-hw-description=..., petalinux-build, petalinux-package, and finally transfer the *.BIN and uImage.ub back to Windows to load onto an SD Card.

 

Are there any Windows based tools or methods that would allow us to take an existing image and just update the *.bit portion, without booting up the linux machine? I understand this would be limited to minor changes (nothing that would require an updated device tree). 

 

Thanks,

0 Kudos
1 Solution

Accepted Solutions
johnmcd
Xilinx Employee
Xilinx Employee
1,947 Views
Registered: ‎02-01-2008

If you are only changing the .bit, then you can use bootgen on the windows machine to repackage the necessary files into a new BOOT.BIN which gets copied onto SD.

 

Bootgen uses a .bif file to describe the contents of BOOT.BIN. So copy onto windows the petalinux generated files from the 'images' dir: bl31.elf and u-boot.elf

 

Also, either copy from linux, or create on windows SDK using same hdf: fsbl.elf, pmufw.elf

 

and get your .bit

 

Now create a .bif file with contents something like:

my_image:
{
    [bootloader, destination_cpu = a53-0]            ./fsbl.elf
    [destination_cpu=pmu]                                   ./pmufw.elf

    [destination_device=pl]                                   ./my.bit
    [destination_cpu=a53-0,exception_level=el-3,trustzone] ./bl31.elf
    [destination_cpu=a53-0,exception_level=el-2]                ./u-boot.elf
}

 

And then in sdk, select create boot file and point to the above created .bif. Make sure your paths are correct. Or just use the sdk gui to create a .bif that looks comparable to above.

 

Personally, I create a windows shortcut to run something like the following:

%SystemRoot%\system32\cmd.exe /k C:\Xilinx\SDK\2017.4\settings64.bat

And then from that dos window, you can enter the command:

bootgen -w -image my_boot.bif -arch zynqmp -o BOOT.BIN

 

View solution in original post

0 Kudos
2 Replies
johnmcd
Xilinx Employee
Xilinx Employee
1,948 Views
Registered: ‎02-01-2008

If you are only changing the .bit, then you can use bootgen on the windows machine to repackage the necessary files into a new BOOT.BIN which gets copied onto SD.

 

Bootgen uses a .bif file to describe the contents of BOOT.BIN. So copy onto windows the petalinux generated files from the 'images' dir: bl31.elf and u-boot.elf

 

Also, either copy from linux, or create on windows SDK using same hdf: fsbl.elf, pmufw.elf

 

and get your .bit

 

Now create a .bif file with contents something like:

my_image:
{
    [bootloader, destination_cpu = a53-0]            ./fsbl.elf
    [destination_cpu=pmu]                                   ./pmufw.elf

    [destination_device=pl]                                   ./my.bit
    [destination_cpu=a53-0,exception_level=el-3,trustzone] ./bl31.elf
    [destination_cpu=a53-0,exception_level=el-2]                ./u-boot.elf
}

 

And then in sdk, select create boot file and point to the above created .bif. Make sure your paths are correct. Or just use the sdk gui to create a .bif that looks comparable to above.

 

Personally, I create a windows shortcut to run something like the following:

%SystemRoot%\system32\cmd.exe /k C:\Xilinx\SDK\2017.4\settings64.bat

And then from that dos window, you can enter the command:

bootgen -w -image my_boot.bif -arch zynqmp -o BOOT.BIN

 

View solution in original post

0 Kudos
stephenm
Moderator
Moderator
1,632 Views
Registered: ‎09-12-2007
If you are changing the HW. Then you would prob be advised to update the devicetree too.

You can use the SDK to update the devicetree. You would need to source the devicetree generator from git hub. See the wiki article below:
http://www.wiki.xilinx.com/ZCU102+Image+creation+in+OSL+flow

The flow here uses hsi, but you can add the repo directory in the xilinx tools -> repositories. Then just create a nap with os set to devicetree.

You would need to compile the DT too using the DT compiler. Then just place the image, dtb and the roots on your SD card (assuming you are booting from SD), and use the uboot bootm command to boot Linux
0 Kudos