PYNQ: PYTHON PRODUCTIVITY FOR ZYNQ

Error building from bsp

I built a bsp with petalinux (2018.3) and when I build the overlay I get this error… what is wrong?

ERROR: Task (/opt/pkg/petalinux/2018.3/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 702 tasks of which 602 didn't need to be rerun and 1 failed.

    Summary: 1 task failed:
      /opt/pkg/petalinux/2018.3/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_configure
    Summary: There was 1 ERROR message shown, returning a non-zero exit code.
    ERROR: Failed to build device-tree
Makefile:298: recipe for target '/home/joan/pynq/sdbuild/build/zturn/petalinux_project/images/linux/system.dtb' failed
make: *** [/home/joan/pynq/sdbuild/build/zturn/petalinux_project/images/linux/system.dtb] Error 255

Alright, it turns out MACHINE_NAME in DGT has to be one of the pre-defined values. What does this imply? The BSP is board agnostic, so it should be the same with any choice having the same chip, am I right?

Because petalinux pulls the machine name to apply the related configuration. It must be one of the valid machine names and cannot be arbitrary.
Valid names are listed here (pick a version and look at the BOARD folder)
Also, the BSP is very board-specific (the same chip is not really enough), I don’t really understand what you mean there, perhaps I am interpreting it wrong.

You say “the BSP is very board-specific” and my understanding is the opposite… I read somewhere that the BSP is the lowest software layer where Linux runs on top of, so it knows about the processor (that is the same whatever the board). If the choices of MACHINE_NAME are limited, the usefulness drops accordingly, unless Xilinx wants to focus their business on their dev boards, which I don’t think it’s the case or the right thing to do…

Simple example: the device-tree (that’s what the machine name is for). The device-tree takes into account e.g IO which is definitely board-specific, or other chips like Bluetooth or WiFi modules, which again, are board-specific. The bsp is the Board Support Package, so it is the layer of software to support the board, as the name suggests.
For the MACHINE_NAME, there are some that are generic, and you can use them and make your modifications to provide Petalinux with the correct configuration you want, following the petalinux documentation. This is what we do for instance for the Pynq-Z1 and Pynq-Z2.

I see… I suppose the way is to choose the closest board and patch the device tree

1 Like

Exactly! That is the flow to follow. And if you think about it, it makes sense…unless Xilinx (or partners) directly supports the board in petalinux, you will need to provide the required changes to make linux see all your on-board components. There’s no way to possibly detect these info automatically.

EDIT: for certain things more related to the chip itself they are actually fetched automatically providing a .hdf file (produced in Vivado from a design) to petalinux when creating the project. For other components, it is really not the case.

I might end up liking that Pynq thing after all… LoL

1 Like