Jump to content
  • 0

Compile U-Boot Files For PYNQ-Z1 From Source


amd

Question

Hi folks,

since weeks I try to compile a u-boot version for the PYNQ-Z1 board. I want to work on some low-level programming for which I need a purely U-Boot systems (without a linux kernel or root file system). The u-boot system will load an image file and a bitstream file to run.

I followed the steps on:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841973/Build+U-Boot

and the answer to a fellow OP

When following the wiki I will have the problem of the missing config files for the pynq-z1 board.

Following the answer in the posting lead to some issues during compilation with problems due to old openSSL version for the referred Repository Version 2018.3 of https://github.com/Xilinx/u-boot-xlnx .

Fixing them (rightly or wrongly, not sure) will provide the u-boot files. However I am not sure which one of the filesI need to copy to my sd card, since I do not get any UART output, while trying.

I would really appreciate some instructions for

  1. Where to get the config files for the PYNQ-Z1 board
  2. How to include them to the (current version) of https://github.com/Xilinx/u-boot-xlnx repository
  3. Which files  I need to copy to my sd card.

I appreciate every help.

Best

Ahmed

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @amd,

If you just want to load a bitstream at boot time then a BOOT.BIN file containing fsbl and bitstream It is sufficient. you can use Xilinx bootgen tool for that. https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841976/Prepare+boot+image

On SD card make sure to use FAT32 for first partition where BOOT.BIN is placed. https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841655/Prepare+Boot+Medium

Otherwise:
1. Config files for PYNQ-Z1 board are added by patch files that can be found in https://github.com/Xilinx/PYNQ/tree/master/boards/Pynq-Z1/petalinux_bsp/meta-user/recipes-bsp/u-boot directory

2. By applying the patches found in above directory.

3. PYNQ build system uses petalinux internally which in turn requires Xilinx bootgen tool to generate the BOOT.BIN. ($ petalinux-package --boot --u-boot --fpga --fsbl --force)

This file contains:
  a. fsbl;
  b. bitstream.bin;
  c. u-boot; (this u-boot contains a dtb)
To boot the board up to second stage bootlader[ssbl](u-boot) you need BOOT.BIN and boot.scr|uEnv.txt (I am guessing it is optional for only this however u-boot needs a boot script|environment)
The boot flow is as follows:
  A. zsbl searches for BOOT.BIN from which fsbl is loaded and run.
  B. After that fsbl will load the bitstream (found in BOOT.BIN) [Also this step can be performed by u-boot; command `fpga` is required for this]
      If it fails throws a short error message on UART(when you build the fsbl you can add the debug flag for more output.)
  C. In the end u-boot(found in BOOT.BIN) is loaded and started: u-boot prompt is available on UART.

 Using petailnux to build all this is way more easy but it depends on what you want to accomplish. If you still want to run the PYNQ OS|distribution in the end or you just want to use the board for stand alone application.

So if you manually compile u-boot then make sure the fsbl is actually working if included in BOOT.bin

Edited by Ionel
Link to comment
Share on other sites

  • 0

Hi @Ionel,

 

first of all big thanks for this detailed description. I will look tomorrow into it. Just a short comment to your last sentence regarding PetaLinux.

I considered using petaLinux, but the only tutorial and description I found are always to have a running linux system in the end, which is not my goal.

In the very very end I want to have a u-boot system, which should run few instruction at boot time/after booting up:

1. load the bitstream "fpga.bit" via tftp server

2. run the the fpga.bit

3. load the kernel.img (self programmed) via tftp server

4. run kernel.img

 

not more no less. This was actually some kind of workflow in University during the operating system course.

 

If you have anything to add to this comment, I would be very glad. Otherwise thanks a lot: I was not even sure, if anyone would answer my question in the first place.

 

Best Regards

 

Ahmed

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...