Pynq Z2 Petalinux boot and serial?

Hello,

Do I need to change/set the UART used for serial console in petalinux config when using the bsp with petalinux built from here PYNQ/boards/Pynq-Z2/petalinux_bsp at master · Xilinx/PYNQ · GitHub if I do what are the settings exactly ?

Also what should be the partition/file structure for the SD card exactly ?

1 Like

Ok this is frustrating, I can not get the SD to boot…I assume I need that green Done LED on the board to show ? Nor can I probably as a result of the above serial connect to the UART at all ? , Putty just beeps at me when I try to connect to COM4 which is where the UART seems to be ?

There seems to be on the whole little documentation/guidance regarding the Z2 and its use beyond booting the supplied Pynq image and documentation of the Pynq environment itself.

As a result I have been following the following where I think its appropriate:
https://assil.me/2017/10/24/building-a-petalinux-project.html

But with no specific instructions of any kind I am now lost…

The green “done” is the bitstream being loaded to the FPGA. This happens after the system boots in the standard Z2 boot image. This step is not essential.

What are you trying to do (why are you building a custom image), and why do you think you would need to change the UART settings?
Can you outline the steps you have taken?

Cathal

1 Like

I am simply trying to build the basic image to see if I can indeed do that with no issues.

It turns out the UART settings appear to be correct by default. Or are they ? (default is UART 0)

I think my issue may be in the setup of the SD card ?

I have put the files on the SD card, BOOT.bin, image.ub and the rootfs.tar.gz all in one FAT32 partition.

Have also tried expanding the rootfs archive to a ext4 partition, so there is a 500MB FAT32 with the .bin and .ub files and the rest of the card is a ext4 partition with the rootfs on it.

Also have replicated the partition setup of the Pynq SD card Image only with the files above instead of the ones on the Pynq image.

All of the above seem to not work ? and by that I mean I can not access anything via Putty on ether Windows or Linux via what I assume to be the ports for the USB UART.

A lot of question marks and assumptions there as you can see but that is simply due to zero documentation specific to the Z2 on these points that I can see, and following more generic guides that I have found via googling have not worked ether.

At this point I suspect BOOT.BIN is simply not getting loaded at all for some reason ? (though the Pynq 2.5 SD image loads fine)

The UART setting in petalinux-configure and/or the bsp package itself also maybe somehow wrong or mismatched would seem like an unlikely but alternative guess ?

Also perhaps just a bad board in some way ?.. even less likely ?

To help work out what is going on I really could do with someone giving me an explicit guide as to what needs to go on the SD card and where and also what changes (if any) I need to make to the petalinux-configure settings to build the base system using the Z2 bsp from here PYNQ/boards/Pynq-Z2/petalinux_bsp at master · Xilinx/PYNQ · GitHub

Also mentioning again my sources for a guide to build so far have been the following:
https://assil.me/2017/10/24/building-a-petalinux-project.html

Though with modifications to suite my circumstances as best I can work out given pretty much zero official information on this.

1 Like

This is a very odd use case. I think you may have missed some recipes from meta-pynq layer. We never tested the bsp outside of the SD build flow.

I don’t know where you got stuck- is any message showing on terminal, or nothing?

I don’t think your board is broken since you have PYNQ 2.5 image running ok.

Ok another update.

I managed to get a Vitis standalone project working on the board . I imported the Z2 bsp already mentioned in this thread into Vivado, exported to a xsa+bitstream then used that xsa to make a new platform In Vitis and then made the example “hello world” project for that platform and I get the expected output from the serial port, and the green done light even works on the board.

So this tells me that somehow the Petalinux build process is broken in some way for this board using the Z2 BSP unless something is done which you clearly have done to the Pynq Image as that works.

All I wish to know is what is that thing(or things) you have done ?

Again to be super clear about what I am trying to do. I am trying to boot the “default/standard/plain/not containing Pynq” Petalinux image created by the Petalinux tools made with the Z2 BSP mentioned. The goal being a “Pynqless” SD card image I can then build on as I please.

So I will ask for a third time can I have some Instructions or guidance as to any particular settings I may need to change in petalinux-configure and also if there are any specific SD card layout requirements for the Z2 board in particular that I may need to follow.

1 Like

For the raw bsp constructed, we put a meta-user layer on top of it. It has all the recipes you can see in PYNQ/boards/Pynq-Z2/petalinux_bsp/meta-user/recipes-bsp at master · Xilinx/PYNQ · GitHub, then we put a meta-pynq layer on top: PYNQ/sdbuild/boot/meta-pynq at master · Xilinx/PYNQ · GitHub.

For the SD card partition, check create_partitions.sh script and create_mount_img.sh.

Ok, how exactly do I apply the bsp recipes specifically ? i.e these

Because I figure doing that and looking at the .sh files will help me sort this issue a lot.

Keep getting an error when trying to add the bsp recipes:

Following this: https://www.zachpfeffer.com/single-post/Add-a-Yocto-Layer-to-a-PetaLinux-Project-and-Build-a-Recipe-in-the-Layer-with-PetaLinux-Tools

Putting the contents of:

Into the directory made following that guide:
/components/ext_source

Gets me the following error:
ERROR: Failed to add user layer: /home/mfnyuser/Z2-zynq/components/ext_source/meta-example

Please advise ?

Blank post to bump this to make replys work.

1 Like

Trying to reply bump again as I messed up the last one ? hopefully rock or cathal sees this and the additional questions and such ?

The TLDR of all this is:

The Pnyq SD card image works.

Standalone applications using Vitis seem to work, both via JTAG and putting a BOOT.BIN on the SD card generated from Vitis standalone application build process.

Attempting to make a Petalinux image “from scratch” does not work, nor does trying to make a Linux Application using Vitis, both of these fail it seems to even load the BOOT.BIN.

Why is the provided BSP seemingly unsuitable as is(minus the recipes ?) for anything other then Standalone Applications ?

To take a step back, did you check out the documentation here?:
https://pynq.readthedocs.io/en/v2.5.1/pynq_sd_card.html#building-the-image

Or are you only concerned about making your own Petalinux image for this board? (i.e. a non-PYNQ image?)

Cathal

Yes, bottom line is I want the ability to “roll my own” Linux based image (without Pynq included) ether via the standard Petalinux tools, or actually even better via Vitis as from what I have seen If I could get this working in Vitis it would be very nice indeed, but since this does not even work in the standard Petalinux tools I feel this is unlikely to happen unless a developer can specifically help me out with this ?, perhaps modify the BSP in some way so that ether Petalinux or Vitis … or both will work “fully” ?

OK, understood. Apologies, I thought you were having issues with PYNQ image build. You may be better asking on the Xilinx forums. There is a section there for PetaLinux.
The PYNQ-Z1/Z2 are very similar to the Digilent ARTY Z7. This may be a good resource to follow, and I think you can use the same BSP:

Cathal

I think what would be helpful maybe would be a step by step guide on how to apply those recipes for the BSP ? as I strongly suspect that would help solve this issue, could someone here do that for me ?

Ok so an update,

I made my own BSP from scratch using a basic zynq_processor design and built a Petalinux image from that and it boots.

So something in your BSP is broken it seems unless those recipes are added ? so again I will ask how to I manually apply them ?

A reply to bump this.

Helo @mfny, we do not have a step by step tutorial on how to build a custom petalinux flow as this forum is dedicated to pynq. However, I can give you some pointers.
What petalinux version are you using?
I’d recommend you to check the documentation Documentation Portal
Page 109 states “Note: Please make sure board and user specific dtsi entries are added to project-spec/metauser/recipes-bsp/device-tree/files/system-user.dtsi.”
Page 111 and 112 delve deep on how to include custom recipes for uboot

This two sections should help you to tackle your problem.

2 Likes