How to Compile PlutoSDR Firmware (plutosdr-fw) for SD Card Boot and Obtain the Cross‑Compilation Sysroot

How to Compile PlutoSDR Firmware (plutosdr-fw) for SD Card Boot and Obtain the Cross‑Compilation Sysroot

How to Compile PlutoSDR Firmware (plutosdr-fw) for SD Card Boot and Obtain the Cross‑Compilation Sysroot

A complete, no-shortcut guide to compiling the PlutoSDR firmware from source — includes cloning the repository with submodules, Vivado/Vitis 2022.2 setup, build dependencies, environment variables, building firmware, generating SD card boot images, and extracting the sysroot for cross‑compiling standalone applications.

Environment Preparation

Clone the Firmware Source Code

First, clone the official PlutoSDR firmware repository:

$ git clone --recursive https://github.com/analogdevicesinc/plutosdr-fw.git
Important: The --recursive flag is essential. Without it, the repository will be incomplete — the firmware references Linux kernel, Buildroot, and other submodules. Total size is approximately 4.3 GB.

After cloning, check which version of Vivado is required:

$ cd plutosdr-fw
$ grep -i REQUIRED_VIVADO_VERSION $(find ./ -name "adi*.tcl") | grep set

If the output looks like this, Vivado 2022.2 (Vitis) is required:

set required_vivado_version "2022.2"

Install Vivado & Vitis 2022.2

Download Vitis 2022.2 from the Xilinx archive page (Linux version). Use this direct link if available. The download is an online installer — the complete offline package is extremely large.

Make the installer executable and run it:

$ chmod +x ./Xilinx_Unified_2022.2_1014_8888_Lin64.bin
$ ./Xilinx_Unified_2022.2_1014_8888_Lin64.bin

Installation steps:

  1. Log in with your Xilinx account
  2. Select Vitis as the installation type (first option)

Recommended installation path: /opt/Xilinx/. Create the directory with proper permissions:

$ sudo mkdir /opt/Xilinx/
$ sudo chmod 777 /opt/Xilinx/

Then proceed with the installation and wait for it to complete.

Install Required Runtime Libraries

$ sudo apt-get install git build-essential ccache device-tree-compiler dfu-util \
  fakeroot help2man libncurses5-dev libssl1.0-dev mtools rsync u-boot-tools bc \
  python cpio zip unzip file wget libmpc-dev libgmp-dev

Set Environment Variables

Run the following commands directly in your terminal:

$ export CROSS_COMPILE=arm-linux-gnueabihf-
$ export PATH=$PATH:/opt/Xilinx/Vitis/2022.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin
$ export VIVADO_SETTINGS=/opt/Xilinx/Vivado/2022.2/settings64.sh
Note: If you installed Xilinx tools to a different location, adjust the paths in the second and third commands accordingly.

Start Compilation

Ensure you have an active internet connection. From the firmware source root directory (plutosdr-fw/), run:

$ make

The build process will take approximately 30 minutes with significant command‑line output. If it completes without errors, verify the output:

$ ls -AGhl build

A successful build will show output similar to (total size ~543 MB):

total 543M
-rw-rw-r-- 1 kloz  294 4月  15 21:23 aie_primitive.json
-rw-rw-r-- 1 kloz  14M 4月  15 21:24 ant.dfu
-rw-rw-r-- 1 kloz  14M 4月  15 21:24 ant.frm
-rw-rw-r-- 1 kloz   33 4月  15 21:24 ant.frm.md5
-rw-rw-r-- 1 kloz  14M 4月  15 21:24 ant.itb
-rw-rw-r-- 1 kloz  23M 4月  15 21:24 antsdr-fw-v0.38-dirty.zip
-rw-rw-r-- 1 kloz 696K 4月  15 21:24 antsdr-jtag-bootstrap-v0.38-dirty.zip
-rw-rw-r-- 1 kloz   69 4月  15 21:24 boot.bif
-rw-rw-r-- 1 kloz 510K 4月  15 21:24 boot.bin
-rw-rw-r-- 1 kloz 510K 4月  15 21:24 boot.dfu
-rw-rw-r-- 1 kloz 639K 4月  15 21:24 boot.frm
-rw-rw-r-- 1 kloz 460M 4月  15 21:24 legal-info-v0.38-dirty.tar.gz
-rw-rw-r-- 1 kloz 636K 4月  15 21:07 LICENSE.html
-rw-rw-r-- 1 kloz 535K 4月  15 21:23 ps7_init.c
-rw-rw-r-- 1 kloz 536K 4月  15 21:23 ps7_init_gpl.c
-rw-rw-r-- 1 kloz 4.2K 4月  15 21:23 ps7_init_gpl.h
-rw-rw-r-- 1 kloz 3.6K 4月  15 21:23 ps7_init.h
-rw-rw-r-- 1 kloz 2.8M 4月  15 21:23 ps7_init.html
-rw-rw-r-- 1 kloz  36K 4月  15 21:23 ps7_init.tcl
-rw-r--r-- 1 kloz 6.4M 4月  15 21:13 rootfs.cpio.gz
drwxrwxr-x 6 kloz 4.0K 4月  15 21:24 sdk
-rw-rw-r-- 1 kloz 2.4M 4月  15 21:23 system_top.bit
-rw-rw-r-- 1 kloz 835K 4月  15 21:23 system_top.xsa
-rwxrwxr-x 1 kloz 473K 4月  15 21:24 u-boot.elf
-rw-rw---- 1 kloz 128K 4月  15 21:24 uboot-env.bin
-rw-rw---- 1 kloz 129K 4月  15 21:24 uboot-env.dfu
-rw-rw-r-- 1 kloz 7.7K 4月  15 21:24 uboot-env.txt
-rwxrwxr-x 1 kloz 4.4M 4月  15 21:06 zImage
-rw-rw-r-- 1 kloz  24K 4月  15 21:13 zynq-ant.dtb

Generate SD Card Firmware

To create a bootable SD card firmware image (so you can boot your custom firmware from an SD card instead of the internal flash), run:

$ make sdimg

The output will be in the build_sdimg/ directory with five files:

Copy these five files to an SD card, set the boot jumper on your PlutoSDR to SD card boot mode, and your device will run the custom firmware you just compiled.

Obtain the Cross‑Compilation Sysroot

For cross‑compiling applications that run natively on the PlutoSDR (standalone/headless operation), you need the sysroot — the target root filesystem. It is located at either:

  • /plutosdr-fw/buildroot/output/staging/
  • /plutosdr-fw/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/
Pro tip: Use this sysroot as the --sysroot flag when cross‑compiling with the Linaro toolchain. This ensures your compiled binaries link against the exact libraries present on the PlutoSDR, enabling true standalone execution.

Example cross‑compilation command:

$ arm-linux-gnueabihf-gcc --sysroot=/path/to/sysroot -o my_app my_app.c

Summary

  • Clone the firmware with --recursive to include all submodules (~4.3 GB)
  • Install Vivado/Vitis 2022.2 (online installer, ~30 min)
  • Install build dependencies via apt-get
  • Set environment variables (CROSS_COMPILE, PATH, VIVADO_SETTINGS)
  • Run make to build the firmware (~30 min)
  • Run make sdimg to generate SD card boot files (five files)
  • Use the sysroot in buildroot/output/staging/ or .../sysroot/ for cross‑compilation

Hardware Support

This firmware is designed for the PlutoSDR platform. For a ready‑to‑use PlutoSDR with full frequency support (70MHz–6GHz) and Gigabit Ethernet:


All product names, trademarks, and registered trademarks are the property of their respective owners. This guide is for educational and research purposes. Xilinx Vivado/Vitis requires a valid license (free for the WebPACK edition).

Previous post

Leave a comment