After you have installed the Petalinux, you can create a project from PetaLinux reference BSP. PetaLinux Reference Board Support Package (BSP) files are reference designs that you may use to get up and going quickly. In addition, these designs can be used as a basis for creating your own projects. PetaLinux BSP’s are provided in the form of installable BSP files and include all necessary design and configuration files required to get started. Pre-built hardware and software images included in the BSP packages are ready for download to your board or for booting in the QEMU system simulation environment.
You can download BSP reference designs from here. To download to create and Xilinx account. BSP is specific to development board. In this tutorial ZED BSP is used.
Open the terminal.
Enter the following command
$petalinux-create –t project –n <PROJECT_NAME> -s <PATH_TO_PETALINUX_PROJECT_BSP>
This command will create a project in the working directory. If –n <PROJECT_NAME> option is not entered then project folder name will be same as BSP file name.
You can enter command
$ls
and see the project directory created. In this case the project name is project_zedboard you can see project_zedboard is listed.
PetaLinux provides QEMU support such that the PetaLinux software image can be tested in a simulated environment, without any hardware. We are going to test the PetaLinux reference design with QEMU. QEMU is a free and open-source emulator that performs hardware virtualization. You can know more about from here.
Now goto the directory of the project created before. Enter
$ls
it will be something like this.
Project directory contains pre-built directory which contains reference build.
Enter following command:
$petalinux-boot --qemu --prebuilt 3
This will boot the prebuilt image in QEMU emulation.
You can then login in linux system using username: root and password: root.
To terminate QEMU enter Ctrl+a and then press x.
Till now we have used a prebuilt image and tested in QEMU. Now we will use the same prebuilt image in hardware. We will boot Zedboard with this prebuilt Linux through sdcard.
Make sure the Sdcard is miminum 4gb and formatted in FAT32. Copy All the contents of prebuilt directory into the sdcard. For SD card boot, the important files are image.ub(Linux kernel + device tree), rootfs.tar.gz (BusyBox-based root filesystem), and Boot.bin(FSBL+bitsream+U-Boot). But for simplicity we copy all the contents for now. I will explain what each file is later on.
Now make sure your jumper are set in the Zedboard as shown below. This jumper settings is required to boot from sdcard.
Put the SD card in the Zedboard and power on the zedboard.Connect the UART(Serial Communication) port on the Zedboard to your host computer. Open app called Putty which you can download from here.
In Windows system:
Goto Device Manager and see under ports. You should see the port name like COM11 which the interface the Zedboard is connected through.
You can goto Device Manager through Run(Win key+R) and typing devmgmt.msc.
When you identify the port name, open Putty and configure as shown in figure. Make sure the speed(baudrate) is 115200. Then click open.
Putty will setup a serial connection to Zedboard and we can see the system booting.
Now you can login using username: root and password: root.
References:
- https://assil.me/2017/10/24/building-a-petalinux-project.html
- https://www.beyond-circuits.com/wordpress/tutorial/tutorial23/
- http://svenand.blogdrives.com/archive/182.html#.W03KgtIzZPY
- PetaLinux Tools Documentation: WorkFlow Guide(UG1156)
- PetaLinux Tools Documentation: Reference Guide(UG1144)