<project_directory>/<project_name>.sdk/
In case you need it (but usually you shouldn't), default bitstream location is:
<project_directory>/<project_name>.runs/impl_1/
petalinux-create --type project --template zynq --name <boot_project_name> cd <boot_project_name>
For UltraScale+:
petalinux-create -t project --template zynqMP --name <boot_project_name>
petalinux-config --get-hw-description <path_to_vivado_project_directory>/<project_name>.sdk/
Subsystem AUTO Hardware Settings -> Advanced bootable images storage Settings -> boot image settings : set ‘image storage media’ option to ‘primary sd’ -> kernel image settings: set ‘image storage media’ option to ‘primary sd’ -> dtb image settings : set ‘image storage media’ option to ‘primary sd’ Image Packaging Configurations: set ‘Root filesystem type’ option to ‘SD card’ : uncheck 'Copy final images to tfpboot'
Select Exit
to write the configuration.
In case you want to reconfigure boot settings, run:
petalinux-config
petalinux-config -c kernel
Hint: you can use vim-like search /<search_string>
to list all enabled drivers/modules.
Remember to Save changes before exit – it seems that there is no autosave!
uio_pdrv_genirq
enable kernel modules in kernel config: petalinux-config -c kernel
by navigating through settings tree and enabling modules (there should be '<M>', not '<*>'):
Device Drivers -> <*> Userspace I/O drivers -> <M> Userspace I/O platform driver with generic IRQ handling <M> Userspace platform driver with generic irq and dynamic memory
vim ./project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
and add the entry at the end of this file:
&axi_gpio_0 { compatible = "generic-uio"; };
for every hardware module you have.
Please notice that axi_gpio_0
is only an example of module name!
default_bootcmd=run uenvboot; run cp_kernel2ram && bootm ${netstart}
is created by PetaLinux as
default_bootcmd=run uenvboot; run cp_kernel2ram && run cp_dtb2ram && booti ${netstart} - ${dtbnetstart}
with the typo in booti
instead of bootm
command.
To fix this bug, edit the platform-top.h
file (it would not be overwrite if you reconfigure the boot or kernel):
vim ./project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h
and add the following entry at the end:
/* Due to a bug where having u-boot load dtb from SD card causes the boot * command to default to using booti instead of bootm on Zynq, the defult build * fails to boot. This boot command override is a temporary workaround. */ #ifdef CONFIG_BOOTCOMMAND #undef CONFIG_BOOTCOMMAND #define CONFIG_BOOTCOMMAND "run uenvboot; run cp_kernel2ram && run cp_dtb2ram && bootm ${netstart} - ${dtbnetstart}" #endif
petalinux-build
–get-hw-description
): ls ./images/linux/*.bit
BOOT.BIN
image: petalinux-package --boot --format BIN --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/<bit_filename>.bit --u-boot