cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
959 Views
Registered: ‎05-07-2018

Petalinux Build Steps for Custom Board with Zynq Ultrascale+

Hello,

I have a Zynq Ultrascale+ MPSoc Development Board(ZCU106). I applied HD-SDI Video Capture and Display Project on it and it works fine. Now I have a custom board and I'm trying to apply HD-SDI Video Capture project on it but I have a DDR3 instead of DDR4 and also my FPGA is different. Therefore I changed FPGA type and DDR configurations and left the other settings same as the reference design when I created the Vivado Project. I generated bitstream, exported hardware and launched SDK.

Xilinx supplies the BSP File for the specific boards and in the reference design they creating petalinux project with BSP:

% cd $TRD_HOME/apu/vcu_petalinux_bsp

% petalinux-create -t project -s xilinx-vcu-trd-zcu106-v2019.1-final.bsp

Then configure the petalinux project with HDF File:

% cd xilinx-vcu-trd-zcu106-v2019.1-final

% petalinux-config --get-hw-description=<Path to prebuilt HDF>

However I have a custom board and I don't have the BSP File. I'm trying to create the Petalinux Project with my HDF File. My terminal commands were:
 
 
% petalinux-create --type project --template zynqMP --name vcu_sdirx_petalinux
% cd vcu_sdirx_petalinux
% petalinux-config --get-hw-description='/home/yonetici/v_projects/vcu_script/vcu_sdirx/vcu_sdirx.sdk'
I created my own device tree file by following the steps in this page . Then I copied my device tree files to project-spec/meta-user/recipes-bsp/device-tree/files folder and renamed it to "system-user.dtsi". Then in terminal:
 
% petalinux-build
% petalinux-build --sdk
% petalinux-package --sysroot
% cd images/linux
% petalinux-package --boot --fsbl zynqmp_fsbl.elf --u-boot u-boot.elf --pmufw pmufw.elf --fpga system.bit
 
After these steps, I tried to boot from JTAG by following the instructions in UG1137 page 160 (v11.0). My uart output is:
 
#SERDES initialization timed out
NOTICE: ATF running on XCZU5EG/EV/silicon v4/RTL5.1 at 0xfffea000
NOTICE: BL31: Secure code at 0x60000000
NOTICE: BL31: Non secure code at 0x8000000
NOTICE: BL31: v2.0(release):xilinx-v2018.3-720-g80d1c790
NOTICE: BL31: Built : 12:11:48, Jan 29 2020
PMUFW: v1.1
zynqmp_clk_get_peripheral_rate mio read fail
failed to get rate
zynqmp_clk_get_peripheral_rate mio read fail
failed to get rate
zynqmp_clk_get_peripheral_rate mio read fail
failed to get rate
zynqmp_clk_get_peripheral_rate mio read fail
failed to get rate
zynqmp_clk_get_peripheral_rate mio read fail
failed to get rate
No serial driver found
### ERROR ### Please RESET the board ###
 
I guess there is a problem in my Vivado design and I'm currently working on it. My question is how can I be sure about my generated device tree? I also wonder if I compiled Petalinux correctly. Did I miss anything?
 
Thanks in advance.
0 Kudos
4 Replies
Highlighted
944 Views
Registered: ‎07-23-2019

 

Same tears here. The key is in the device tree hack. Xilinx, of course, don't teach about this, is not their business. And unfortunately there isn't much material to learn, and if there is, too shallow. I found lots, really lots of deceiving posts kind of "build petalinux for a custom board in a few minutes" but isn't that easy. Is not good allowing so many information that is simply not true. Even if it is desirable it was easy. A pleasant lie harms more than a painful truth.

Update: unless success is to get the board to boot and login, even if devices don't work and that 'thing' as an OS is probably useless. That's really easy to achieve. 

Highlighted
Contributor
Contributor
802 Views
Registered: ‎05-07-2018

Hello @archangel-lightworks  ,

I couldn't understand your update message, can you explain it please?

Thanks in advance.

0 Kudos
Highlighted
Explorer
Explorer
789 Views
Registered: ‎04-19-2018

 

@silat14  Some people build linuxes that fail at attaching peripherals and don't work properly but if they can login and type ls, they say "that's it, done, here you have your linux"

Highlighted
Visitor
Visitor
320 Views
Registered: ‎02-20-2014

It seems that even after adding your custom device tree as above, there is still the issue of the configured "MACHINE" name.  If this is set to a standard development board, then your custom device tree content would be applied on top of the standard board definitions from the DTG repository (device-tree-xlnx) .  On the other hand, if you customize the machine name, then the device tree generator will look for a custom device tree in the repository by that name, and fail.  From the post here: https://forums.xilinx.com/t5/Embedded-Linux/Custom-device-tree-board-file-not-found-when-building-device/m-p/930774 

if you can create an appropriate bbappend file to set the "periph_type_overrides" variable for the device-tree recipe then a custom "top level" board device tree could be identified and located as the foundation.  Does anyone have such a bbappend that has been demonstrated to work?  

Update, t+30 hours:  The response by stephenm to the post: https://forums.xilinx.com/t5/Embedded-Linux/PetaLinux-2017-3-Completely-custom-Device-Tree/m-p/814945#M23167 seemed to do the trick.  Placed the custom device tree under  <repo root device-tree-xlnx>/device_tree/data/kernel_dtsi/2019.1/BOARD/<MACHINE_NAME>.dtsi, then petalinux-config with same MACHINE_NAME under DTG Settings, created the patch from <repo root> as in the post and placed the patch in the device-tree recipe where indicated, edited device-tree.bbappend. Not sure why in the post stephenm says to place the patch also under plnx_workspace.  And in 2019.1 that path is a little different.   But it worked at least once for me. 

 

0 Kudos