Pluto SDR PYNQ Image

Hi all! I recently presented the PYNQ image that I created for the Analog Devices Pluto SDR / AntSDR E200 at the 2024 GNU Radio Conference, and @jgoldsmith suggested that I post the project on this forum as well.

I started my project by creating a PYNQ image for the Pluto SDR, with the hope of creating a low-cost alternative to the RFSoC 4x2 kit for learning FPGA acceleration in software defined radio. The Pluto SDR has a few constraints that make porting PYNQ somewhat difficult. For starters, the ADI firmware for the Pluto SDR is created using Buildroot, not PetaLinux. My first task was converting the Linux system configuration into a PetaLinux BSP for compatibility with the PYNQ sdbuild flow.

The PYNQ root filesystem was much too large to fit into the 32 MB of flash memory onboard the Pluto. I solved this issue by hosting the root filesystem and boot files on an external USB storage drive, and then booted the system manually from the U-Boot console by loading the kernel into RAM and pointing to an external rootfs.

The Linux drivers for the AD936x RFIC family are not in mainline Linux, so the Analog Devices fork of the Linux kernel had to be integrated into the PYNQ build flow as well. I solved this problem by integrating the meta-adi Yocto layer into my PetaLinux BSP.

These steps all worked, and I was able to boot into PYNQ running on my Pluto. Here’s an image of what the hardware setup looks like:

I ran into some issues when actually loading overlays, which I believe are related to some missing device tree nodes. I’m still working on solving that issue.

I also created a fork of the MicroPhase PYNQ image for their AntSDR E200 with some significant improvements. I added a PYNQ userspace package for the Analog Devices IIO software, which allows PYNQ systems to interface with IIO devices both locally and from remote IIO contexts. I used the AntSDR E200 to create a demonstration FM radio hardware accelerator using PYNQ and GNU Radio. You can see a video demo of this in the recording of my GNU Radio Conference presentation that I’ve linked below.

I think that combining PYNQ with low-cost SDRs has a lot of potential for enabling simple integration of hardware acceleration into RF signal processing. By using PYNQ and the Jupyter notebook interface, DSP functions can be easily loaded into the datapath to offload high-rate computations before the samples are streamed to a host computer.

Here are a few links to check out if you’re interested in this project:

My GNU Radio Conference presentation goes into more detail, and I have a longer slide deck that I can share upon request (the file size is too large to upload to this post).

Thanks for reading!

2 Likes

Thanks for putting this project together and documenting it. I tried to recursively clone both repos, but it seems that they reference a repo of yours that needs a credential:

fatal: clone of ‘git@github.com:zehicks/hdl.git’ into submodule path xxxxxxx/PYNQ-SDR/antsdr-pynq/hdl’ failed
Failed to clone ‘hdl’. Retry scheduled
Cloning into ‘xxxxxxx//PYNQ-SDR/antsdr-pynq/PYNQ’…
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

All of the submodule repositories should be public, so it sounds like it might be an SSH issue. The submodules are set up to clone via SSH, not HTTPS. Does your GitHub account have an SSH key associated with your machine?

Thanks Zach, I had surmised as much. I’ll regenerate my key to be sure, but I just wanted to give a heads up on this, if it wasn’t working as you intended.

Hi zach,
thanks for the project, well I have a board antsdre200,

Well I clone the repository, then
run the command make, create vivado project and library from adi is ok,

but then I have the error

Makefile:396: *** REBUILD_PYNQ_SDIST not set and PYNQ_SDIST file /home/jdsl/Documentos/antsdr-pynq/PYNQ/sdbuild/prebuilt/pynq_sdist.tar.gz does not exist

I have seen the antsdr-pynq/PYNQ/sdbuild/prebuildt/ directory and the files (pynq_sdist.tar.gz) in that folder are not found

Do I have to create them? and how is it done?
or should I download them and place them in that folder?

thanks

Hey, thanks for taking a look at my project. The PYNQ source distribution can be downloaded here. Follow the instructions linked under the “Build a PYNQ image” section by downloading the PYNQ sdist tarball and also the rootfs tarball.

Thanks zach to answer quickly,

I have followed the recommendations from (PYNQ SD Card image — Python productivity for Zynq (Pynq)),

cp pynq_rootfs.<arm|aarch64>.tar.gz /sdbuild/prebuilt/pynq_rootfs.<arm|aarch64>.tar.gz
cp pynq-.tar.gz /sdbuild/prebuilt/pynq_sdist.tar.gz

I have been able to reconstruct the image to:
Pynq-z1
Pynq-z2
everything is ok,

then, for board e200 I have the error in this task, when build device tree for e200

ERROR: linux-xlnx-5.15.19+gitAUTOINC+b0c1be301e-r0 do_patch: Could not apply patches for zynq-generic.

well, I’ll continue trying to build the image for the board e200, if you have any advice it’ll be very helpful, thanks zach.

attach the file build.log
build.log (98.2 KB)

Can you share the contents of /home/jdsl/Documentos/antsdr-pynq/PYNQ/sdbuild/build/e200/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/linux-xlnx/5.15.19+gitAUTOINC+b0c1be301e-r0/temp/log.do_patch.457078 ?

hi,
attach again the file build.log, because I make a clean the last build and generate again, also the same error.

well, attach the files

build.log
build.log (98.2 KB)

Files:
log.do_patch.25803
run.do_patch.25803
linux-xlnx_2022.1.bb

inside the zip log.25803.zip
log.25803.zip (4.6 KB)

thanks zach

Hmm I don’t see anything obvious that could be going wrong. You are using PetaLinux 2022.1, correct? What command are you using to run the build? Just “make”?

yes, I use Petalinux 2022.1.

I have managed to get for antsdre200 to do everything with the following command sequence

Make base ok
Make pynq/kernel ok

Summarizing

1
clone the repository
git clone --recursive git@github.com:zehicks/antsdr-pynq.git

2

PYNQ repository/sdbuild/scripts/setup_host.sh (It took only once at the beginning to install the tools)

3
download

cp pynq_rootfs.<arm|aarch64>.tar.gz /sdbuild/prebuilt/pynq_rootfs.<arm|aarch64>.tar.gz

cp pynq-.tar.gz /sdbuild/prebuilt/pynq_sdist.tar.gz

4
source /Vitis/2022.1/settings64.sh
source /petalinux-2022.1-final/settings.sh

5
from PYNQ repository/

make base
make pynq/kernel

everithing is ok. :smiley:

the outputs in the
PYNQ repository/PYNQ/sdbuild/output/boot/e200 folder.

When the error happened

The only difference I’ve seen is that when you pass the argument

make all, error building device tree(dbt)
or
make pynq, error building device tree

I still don’t understand the difference make pynq(that commad give error dbt) versus make pynq/kernel(that command work),

many thanks zach

Hello, Zach

Well, the solution for command, make pynq or make all

I’ve checked the Makefile inside the /PYNQ/sdbuild folder
on line 16 and 17

16 #LINUX_VERSION := 5.15.19-xilinx-v2022.1
17 LINUX_VERSION := 5.15.36-xilinx-v2022.1
which is incorrect for version 2022.1

The right thing to do in PYNQ repository/PYNQ/sdbuild/Makefile

16 LINUX_VERSION := 5.15.19-xilinx-v2022.1
17 #LINUX_VERSION := 5.15.36-xilinx-v2022.2

also the version 5.15.36 is for 2022.2

Thanks zach.