PetaLinux开发流程
2019-10-19 本文已影响0人
非鱼知乐
1. Create a new project
petalinux-create -t project --template zynq -n $(project_name)
or
petalinux-create -t project -s $(bsp_file)
2. Import hardware information
petalinux-config --get-hw-description=$(path_to_hdf)
The .hdf file is usually in $(project_name).sdk
folder.
3. Create a new application
petalinux-create -t apps -n $(app_name)
4. Configure kernel
petalinux-config -c kernel
5. Configure rootfs
petalinux-config -c rootfs
Select modules/apps to be enabled.
6. Build
petalinux-build
7. Create BOOT.bin
petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/system.bit --u-boot --force
or
create a file, e.g., boot.bif
, with
image : {
[bootloader] images/linux/zynq_fsbl.elf
images/linux/system.bit
images/linux/u-boot.elf
}
And then, run command:
bootgen -image boot.bif -o i BOOT.BIN -w on
8. Boot file system from SD card
a) Change configuration
When reading hardware configuration
petalinux-config --get-hw-description=xxx
Select Image Packaging Configuration
Root filesystem type (INITRAMFS)
SD card
Or when configuring:
petalinux-config
Select Image Packaging Configuration
Root filesystem type
. Select SD card
as the RootFS type
.
petalinux-build
petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/system.bit --u-boot --force
b) Prepare SD card
cp /tftpboot/BOOT.BIN /media/username/BOOT/.
cp /tftpboot/image.ub /media/username/BOOT/.
sudo cp -a /path-to-compiled-rootfs/* /media/username/rootfs/.