Modify PetaLinux U-Boot so that it can load the image.ub
image. The device tree needs to be modified to set the USB in peripheral mode. The default PetaLinux configuration is set for the USB in host mode. Follow these steps to modify system-user.dtsi
in the PetaLinux project:
<PetaLinux-project>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
Add the following to the
system-user.dtsi
file so that it looks like this:/include/ "system-conf.dtsi" / { gpio-keys { sw19 { status = "disabled"; }; }; }; &uart1 { status = "disabled"; }; &dwc3_0 { dr_mode = "peripheral"; maximum-speed = "super-speed"; };
The modified
system-user.dtsi
file can be found in ref_files/usb_boot released with this tutorial.Build PetaLinux with the following changes:
$ petalinux-build
The following steps describe how to create a usb_boot.bin
comprising rest of the partitions.
Note
Copy the newly generated U-Boot to C:\edt\usb_boot\
.
In the Vitis IDE, select Vitis → Create Boot Image.
Select FSBL and rest of the partitions and set them as shown in the following figure. You can also choose to import the BIF file from the SD boot sequence.
Note
Ensure that you have set the correct exception levels for the TF-A (EL-3, TrustZone) and U-Boot (EL-2) partitions. These settings can be ignored for other partitions.
The PMU firmware partition is not required in this image because it will be loaded by the bootROM before this image (
usb_boot.bin
) is loaded.Click on Create Image to generate
usb_boot.bin
.Note
In addition to
BOOT.bin
andusb_boot.bin
, a Linux image such asimage.ub
is required to boot Linux. Thisimage.ub
is loaded by the DFU utility separately.