Running make in sdbuild folder fails

Hi. I got an error when running make in sdbuild folder :“recipe for target ‘qemu_check_arm’ failed”.


I’ve installed PetaLinux 2018.3 and Vivado 2018.3 on Ubuntu 16.04, with their settings.sh files sourced in bashrc.

source ~/petalinux/settings.sh
source ~/vivado/Vivado/2018.3/settings64.sh
source ~/vivado/SDK/2018.3/settings64.sh

The board I use is ZedBoard-fmcomms3.
I’ve followed the steps below:

  1. create my own PetaLinux BSP at branch 2019_r1
  2. put the BSP and bitstream file into PYNQ/boards/ZedBoard-ADI and create a ZedBoard-ADI.spec file below:
ARCH_ZedBoard-ADI := arm
BSP_ZedBoard-ADI := ZedBoard-ADI.bsp
BITSTREAM_ZedBoard-ADI := system_top.bit
STAGE4_PACKAGES_ZedBoard-ADI := pynq ethernet jupyter
  1. run sdbuild/scripts/setup_host.sh
  2. run make in sdbuild with a prebuilt image bionic.arm.2.4.img by make BOARDS=ZedBoard-ADI PREBUILT=/home/lightwish/zedboardPYNQ_AD9361/PYNQ
    Then the error appears “recipe for target ‘qemu_check_arm’ failed

I have no idea how to solve it. Did I miss some packages? I would appreciate it if you could help me.

Hi there,

Could you try running which qemu-arm-static to make sure it exists and you have access to it? Would also double check if you have sudo access, just doing a sudo ls before running make should do the trick if for any reason your binaries aren’t accessible to your user.

Also the PREBUILT parameter should be pointing to your image file (/path/to/file/bionic.arm.2.4), rather than a directory.

Thanks
Shawn

Hi, thanks for your kind reply.

I just ran which qemu-arm-static and got /usr/bin/qemu-arm-static, which means it exists. And I ran sudo ls at /usr/bin folder and sdbuild folder, and corrected the PREBUILT parameter before running make. But I still got the error.

Can you also check what version it is? With qemu-arm-static -version like the makefile checks. Here’s a relevant post with a qemu version mistmatch, where the resolution might be helpful.

Thanks
Shawn

1 Like

It works! But another error appears.


Seems like another version mismatch with sdx. I’ve just installed vivado 2018.3, not sdx. Vivado 2018.3 should match. Do I need to install sdx?

You might be able to follow the advice here and remove the SDx check on line 310 of the makefile. If possible I would recommend switching to a newer pynq version as the support for that will be far more recent and stable.

Thanks
Shawn

1 Like

Thank you so much for your help! It starts to run make now!

I would like to use the latest version but I am actually following someone else’s project so that I choose the version being tested. Anyway, it’s indeed a good learning experience.

Running make takes time. I will update the result when running make finishes.

Here comes a new error.

There is no /lib/modules/4.14.0-xilinx-v2018.3 directory. I didn’t connect my board when running make. Could this be the reason?

Then I connected my board and tried to re-run make. But simply typing the make command again could not work. How could I run make again?

You mentioned this earlier.

What version of petalinux are you using? Could be a version mismatch, or the way that BSP was generated.

Thanks
Shawn

I’m using PetaLinux 2018.3 at branch 2019_r1, which corresponds to Vivado 2018.3. The versions of PetaLinux and vivado should match. I followed the steps in this project to create my BSP.

Since I’m using Zedboard + fmcomms3, I built my hardware project in adi/hdl/projects/fmcomms2/zed.

But in sdbuild/output there actually exists an image file. Meanwhile, two mounted partitions appear.

When you said you can’t run make anymore, were you getting some error message?

If you run lsblk in your terminal you should see those volumes mounted. You could unmount them using something like (replace paths as they appear in lsblk output)

sudo umount ./build/bionic.zedboardPYNQ_AD9361/boot
sudo umount ./build/bionic.zedboardPYNQ_AD9361

Then you can run make clean and do a fresh image build…

The instructions you linked mention editing the makefile around line 127, have you edited that? There is linux kernel info in those meta layers so probably a good idea to double check.

Thanks
Shawn

I umounted these two volumes and ran make clean, then I could run make again. But still got an error depmod: ERROR: could not open directory /lib/modules/4.14.0-xilinx-v2018.3: No such file or directory. How can I get this 4.14.0-xilinx-v2018.3?

And I did edit the line 127 in makefile as mentioned in this project. I found that my linux kernel version is 4.15, while meta-adi requires 4.14 as listed in this file. May this be the problem?

By the way, here is the log information of make process. May provide some help.

Thanks !
PYNQmake_log.txt (125.9 KB)

You might be able to get this out of petalinux…

What happens if you run find ./build/ -name "4.14.0-xilinx-v2018.3" from your sdbuild directory? I was able to get a folder like /package/lib/modules/5.4.0-xilinx-v2020.2 from one of my recent sdbuilds by doing a similar search. Maybe there is something you can change in your petalinux project?

After I ran find ./build/ -name "4.14.0-xilinx-v2018.3" from /sdbuild, a folder /sdbuild/package showed up. But there didn’t exist /sdbuild/package/lib/modules directory. Here are the contents in /sdbuild/package

How to get this 4.14.0-xilinx-v2018.3 out of petalinux?

I’ve encountered the exact same problem. It turns out that I only have 4.14.0-xilinx- in sdbuild/build/bionic.ZedBoard-ADI/lib/modules/. The folder is just named 4.14.0-xilinx-, lacking a suffix v2018.3.

I also found out that the suffix is related to CONFIG_LOCALVERSION in this link.

I feel that the solution is just somewhere around. I wonder if anybody gets an update on this. If I work around this, I will update in this post.

I SOLVED this issue today by changing “LINUX_VERSION := 4.14-xilinx-v2018.3” in Makefile line 7 to “LINUX_VERSION := 4.14-xilinx-”.

The last part of the log of the successful make is

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): Partition number (1,2, default 2): 
Partition 2 has been deleted.

Command (m for help): Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (206848-14680063, default 206848): Last sector, +sectors or +size{K,M,G,T,P} (206848-14680063, default 14680063): 
Created a new partition 2 of type 'Linux' and of size 5.2 GiB.

Command (m for help): Disk /home/godfly/PYNQ/sdbuild/output/ZedBoard-ADI-2.4.img: 7 GiB, 7516192768 bytes, 14680064 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa51ca6d9

Device                                                 Boot  Start      End  Sectors  Size Id Type
/home/godfly/PYNQ/sdbuild/output/ZedBoard-ADI-2.4.img1 *      2048   206847   204800  100M  c W95 FAT
/home/godfly/PYNQ/sdbuild/output/ZedBoard-ADI-2.4.img2      206848 11052367 10845520  5.2G 83 Linux

Command (m for help): The partition table has been altered.
Syncing disks.

+ total_size=5526184
+ truncate -s 5526184K /home/godfly/PYNQ/sdbuild/output/ZedBoard-ADI-2.4.img
1 Like

It seems that there is a more canonical way to do this, that is, run petalinux-config -c kernel and then go to General setup → Local version, and then change -xilinx- to -xilinx-v2018.3.

Anyway, I’ve posted details at GitHub - Godfly666/zedboard-adi-pynq: Instructions on how to build PYNQ on zedboard with ADI linux kernel.. Hope someone find this helpful.

1 Like