Working on custom pcb dev-board has many challenges. Because, you're in an ambiguous state either it's hardware fault or software, especially when you're new to Xilinx FPGAs.
In this project, I'll show you how to make a Vivado project for custom PCB dev-board and Petalinux build. This will be minimal OS with only UART enabled. We'll upload the build artifacts through JTAG. The chip used in this project is exactly same as the ZCU104 Xilinx zynqMP board. It means you can test this custom build onto zcu104 board also.
There're following steps in this project:
- Vivado Project
- Petalinux Build
- JTAG Boot
Create a Vivado FPGA project and import the Zynq Ultrascale + MPSoC ip core and enable the UART0 on MIO18 and MIO19. As the ZCU104 board has terminal uart on mio18 and mio19. So you'll be able to test this custom build on this board.
All the FPGA project procedure shown in below pictures step by step. Just follow it.
After bitstream generation, export the XSA file for Petalinux project.
Move the XSA file to Petalinux project directory and source the Petalinux environment from installation path.
source <path/to/petalinux/installation/directory/settings.sh>
Example:
source ../petalinux_setup/settings.sh
echo $PETALINUX
/home/abdur/petalinux_setup
After source command make sure the environment is set-up correctly by using below echo command. This command this show you up the Petalinux installation path.
echo $PETALINUX
Result:
/home/abdur/petalinux_setup
Now make the Petalinux project and cd to project path via below command.
petalinux-create --type project --template <PLATFORM> --name <PROJECT_NAME>
Example:
petalinux-create --type project --template zynqMP --name custom_dev_board
Now import the XSA file to Petalinux project.
petalinux-config --get-hw-description <path-to-xsa-file>
Example:
petalinux-config --get-hw-description ../custom_dev_wrapper.xsa
After it, you'll see the below screen.
Here, you've to setup device-tree settings for your custom board. As you're not using any BSP so you don't need to mention the bsp in MACHINE NAME. Just keep it as template in Settings.
Now, it's time to build the project.
petalinux-build
It'll take long time depending upon the PC and network speed.
JTAG BootAfter build completion, open the xsct terminal from Petalinux installation path. Connect the terminal to hardware with connect command and set the frequency and boot to JTAG from below commands.
petalinux-install-path <path-to-petalinux-installation>
connect
jtag targets 1
jtag frequency 15000000
############################
# Switch to JTAG boot mode #
############################
targets -set -filter {name =~ "PSU"}
# update multiboot to ZERO
mwr 0xffca0010 0x0
# change boot mode to JTAG
mwr 0xff5e0200 0x0100
# reset
rst -system
Now load the bitstream, fsbl, u-boot, kernel and rootfs via following command.
petalinux-boot --jtag --fpga --kernel --hw_server-url tcp:127.0.0.1:3121
Comments
Please log in or sign up to comment.