Build Red Pitaya ecosystem
This guide explains how to build the Red Pitaya ecosystem, which includes FPGA bitstreams, Linux kernel, boot files, API libraries, SCPI server, and web applications.
Introduction
What is the ecosystem
The Red Pitaya ecosystem comprises all software and hardware components required for the Red Pitaya to function:
FPGA bitstreams - Hardware logic designs for different applications
Boot components - FSBL, U-Boot, and boot scripts
Linux kernel - Operating system kernel and device tree files
User-space components - API libraries, SCPI server, and web applications
Development tools - Utilities and examples
The ecosystem is packaged as a ecosystem_*.zip file that can be deployed to the FAT32 partition of an SD card.
Ecosystem directory structure
The Red Pitaya source code is organized across multiple directories:
Directory |
Contents |
|---|---|
|
API source code for |
|
WEB applications for the old (pre-2.00) environment (also with controller modules & GUI clients) |
|
WEB interface home page and system management applications |
|
Nginx server with dependencies, Bazaar module & application controller module loader |
|
FPGA design (RTL, bench, simulation, and synthesis scripts) - SystemVerilog based [1] |
|
GNU/Linux operating system components |
|
Patches applied to the official Linux OS |
|
SCPI server |
|
Command line utilities ( |
|
Examples in different programming languages for working with peripherals |
|
Scripts for building an ecosystem and preparing images for memory cards |
Prerequisites
Host system requirements
Red Pitaya ecosystem must be built on a Linux host system.
Red Pitaya ecosystem version |
Host platform OS |
|---|---|
Ecosystem 2.0 and higher |
Ubuntu 22.04 LTS or higher |
Ecosystem 1.04 |
Ubuntu 18.04 LTS or higher |
For additional OS build requirements, refer to the OS build requirements section.
Required software packages
Install the following packages on your Ubuntu host system.
Basic development tools
# Generic dependencies
sudo apt-get install make curl xz-utils git cmake
# U-Boot build dependencies
sudo apt-get install libssl-dev device-tree-compiler u-boot-tools
# Secure chroot
sudo apt-get install schroot
# QEMU for ARM emulation
sudo apt-get install qemu qemu-user qemu-user-static
# 32-bit libraries
sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 lib32stdc++6
Python 3 and build tools
Python 3.10 or higher is required for building some ecosystem components.
sudo apt-get install python3 python3-pip
sudo pip3 install --upgrade pip
sudo pip3 install meson
sudo apt-get install ninja-build
Note
The Meson build system is optional and primarily used during development on x86 PCs.
Xilinx Vivado and SDK
The build process requires AMD Xilinx Vivado and SDK (bare metal toolchain).
Required versions
Red Pitaya ecosystem version |
FPGA development tools |
|---|---|
Ecosystem 2.0 and higher |
Vivado 2020.1 and SDK 2019.1 |
Ecosystem 1.04 |
Vivado 2020.1 and SDK 2019.1 |
Warning
The Vivado and SDK versions are critical. Different versions are not compatible with each other. Ensure you install the exact versions listed above.
Note
Future Red Pitaya OS releases will migrate to Vitis. Currently, Vivado and SDK are still required.
Installation requirements
Follow the installation instructions in the Creating a Vivado SDK/Vitis project and Installation of Vivado sections
Install both Vivado and SDK - During the Vivado installation, ensure the SDK (bare metal toolchain) is also selected
Use default installation paths - Both tools should preferably be installed in their default locations (
/opt/Xilinx/)Create gmake symbolic link - Vivado requires
gmake, which does not exist on Ubuntu:sudo ln -s /usr/bin/make /usr/bin/gmake
Virtual machine installation (optional)
If running Vivado from a virtual machine with installation on a host shared folder:
Use VirtualBox - VMware has a bug in VMware-tools for Ubuntu guests that prevents proper mounting of shared filesystems
Install Ubuntu without encryption - Encrypted installations block some Red Pitaya build procedures
Configure shared folders:
Open VirtualBox settings for your Ubuntu VM
Navigate to Shared Folders
Add the Xilinx installation directory from the host (typically
/opt/)Enable the “Auto-mount” option
Install VirtualBox guest additions:
sudo apt-get install virtualbox-guest-dkmsAccess shared folder - After rebooting, the Xilinx shared folder will be accessible under
/media/sf_Xilinx(requires root privileges)
Red Pitaya source code
Clone the repository
Navigate to your preferred development directory and clone the repository:
git clone https://github.com/RedPitaya/RedPitaya.git
cd RedPitaya
The choice of specific branches or tags depends on your requirements.
Configure environment
Set the LC_ALL environment variable to C (required for locale-sensitive build tools):
echo $LC_ALL
If the command returns an empty line, set it:
export LC_ALL=C
To make this permanent, add the line to your ~/.bashrc file.
Warning
Building the ecosystem on an encrypted home directory is not supported, as schroot cannot access encrypted directories.
Create a separate non-encrypted directory (e.g., /home/ecosystem_build) for building.
Understanding the Build Process
Build environment architecture
The Red Pitaya build process uses multiple environments:
Local machine (x86) - FPGA bitstreams and Linux kernel are compiled here using cross-compilers
Chroot environment (ARM) - User-space applications (API, SCPI server, web apps) are compiled in an emulated ARM environment
The build scripts automatically switch between these environments as needed.
Important notes
Before proceeding, understand these key points:
Not a standard Linux build - The build uses a Red Pitaya virtual ARM environment via
schroot, not a regular cross-compilation setupUbuntu host required - The build must run on Ubuntu (native or VM). Windows, macOS, and WSL are not supported
Automatic environment switching - The build scripts handle switching between x86 and ARM environments automatically. Example of automatic switching:
make -f Makefile.x86 schroot -c red-pitaya-ubuntu <<- EOL_CHROOT make -f Makefile CROSS_COMPILE="" REVISION=$GIT_COMMIT_SHORT EOL_CHROOT make -f Makefile.x86 zip
Disk space requirements - Ensure at least 10 GB of free disk space for source code and compilation
Building the Ecosystem
The full build process creates a complete ecosystem package that can be deployed to Red Pitaya hardware.
Prepare the build environment
Step 1: Load build settings
The settings.sh script configures environment variables for Vivado and SDK. Edit this file if you used non-default installation paths:
source settings.sh
Step 2: Create download cache (optional)
Create a cache directory to store downloaded source tarballs (speeds up subsequent builds):
mkdir -p dl
export DL=$PWD/dl
Step 3: Download ARM Ubuntu environment
Download the pre-built ARM Ubuntu root environment from the Red Pitaya download server.
wget https://downloads.redpitaya.com/downloads/LinuxOS/redpitaya_OS_17-31-47_20-Mar-2025.tar.gz
sudo chown root:root redpitaya_OS_17-31-47_20-Mar-2025.tar.gz
sudo chmod 664 redpitaya_OS_17-31-47_20-Mar-2025.tar.gz
wget https://downloads.redpitaya.com/downloads/LinuxOS/redpitaya_ubuntu_04-oct-2021.tar.gz
sudo chown root:root redpitaya_ubuntu_04-oct-2021.tar.gz
sudo chmod 664 redpitaya_ubuntu_04-oct-2021.tar.gz
Note
Alternatively, you can create your own root environment by following the OS image build instructions.
Step 4: Configure schroot
Create the schroot configuration file: /etc/schroot/chroot.d/red-pitaya-ubuntu.conf
Replace placeholders with:
Absolute path to the downloaded tarball
Comma-separated list of users who should have build access
[red-pitaya-ubuntu]
description=Red Pitaya Debian/Ubuntu OS image
type=file
file=/absolute/path/to/redpitaya_OS_17-31-47_20-Mar-2025.tar.gz
users=your-username
root-users=your-username
root-groups=root
profile=desktop
personality=linux
preserve-environment=true
[red-pitaya-ubuntu]
description=Red Pitaya Debian/Ubuntu OS image
type=file
file=/absolute/path/to/redpitaya_ubuntu_04-oct-2021.tar.gz
users=your-username
root-users=your-username
root-groups=root
profile=desktop
personality=linux
preserve-environment=true
Full build procedure
Option 1: Automated build script
Build for all board models:
cd build_scripts
sudo ./build_OS.sh
Option 2: Manual build
Build step-by-step:
make -f Makefile.x86
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make
EOL_CHROOT
make -f Makefile.x86 zip
Interactive ARM shell
To get an interactive ARM shell for debugging:
schroot -c red-pitaya-ubuntu
Note
Unlike Ecosystem 1.04, version 2.0 and higher builds for all board models simultaneously. Board-specific differences only affect FPGA bitstream compilation.
Option 1: Automated build scripts
Use pre-made build scripts for specific board models:
cd build_scripts
sudo ./build_Z10.sh
cd build_scripts
sudo ./build_Z20_125.sh
cd build_scripts
sudo ./build_Z20_4CH.sh
cd build_scripts
sudo ./build_Z20.sh
cd build_scripts
sudo ./build_Z250_12.sh
Option 2: Manual build
Build step-by-step with MODEL parameter selection:
STEMlab 125-14 uses Z7010, no MODEL parameter required:
make -f Makefile.x86
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make
EOL_CHROOT
make -f Makefile.x86 zip
STEMlab 125-14 4-Input uses Z7020:
make -f Makefile.x86 MODEL=Z20_125_4CH
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make MODEL=Z20_125_4CH
EOL_CHROOT
make -f Makefile.x86 zip MODEL=Z20_125_4CH
SDRlab 122-16 uses Z7020:
make -f Makefile.x86 MODEL=Z20
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make MODEL=Z20
EOL_CHROOT
make -f Makefile.x86 zip MODEL=Z20
SIGNALlab 250-12 uses Z7020:
make -f Makefile.x86 MODEL=Z20_250_12
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make MODEL=Z20_250_12
EOL_CHROOT
make -f Makefile.x86 zip MODEL=Z20_250_12
Interactive ARM shell
To get an interactive ARM shell for debugging:
schroot -c red-pitaya-ubuntu
Partial Rebuild
You can rebuild individual components without rebuilding the entire ecosystem.
Available components
The following components can be built separately:
FPGA and device tree
U-Boot
Linux kernel
API
SCPI server
Free applications
The following components can be built separately:
FPGA and overlays
U-Boot
Linux kernel
API
SCPI server
Console tools and web applications
Setup build environment
Configure Vivado and SDK for cross-compilation:
source settings.sh
On some systems (including Ubuntu 18.04), Vivado’s library setup can conflict with system libraries. Disable Vivado library overrides if needed:
export LD_LIBRARY_PATH=""
Configure Vivado, SDK, and cross-compilation tools:
source settings.sh
export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm
export PATH=$PATH:/opt/Xilinx/Xilinx/Vivado/2020.1/bin
export PATH=$PATH:/opt/Xilinx/SDK/2019.1/bin
export PATH=$PATH:/opt/Xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/
Package the ecosystem
After building components, package them into a zip archive:
make -f Makefile.x86 zip
After building components, package them into a zip archive:
make -f Makefile.x86 zip
Build FPGA bitstream and device tree
Each FPGA version uses device tree overlays. Build for specific board models:
make -f Makefile.x86 fpga MODEL=Z10
make -f Makefile.x86 fpga MODEL=Z20
make -f Makefile.x86 fpga MODEL=Z20_125
make -f Makefile.x86 fpga MODEL=Z20_125_4CH
make -f Makefile.x86 fpga MODEL=Z20_250_12
For detailed instructions, see building the FPGA.
Note
Build only the models you need to speed up the build process.
Build FPGA bitstream and device tree sources:
make -f Makefile.x86 fpga
For detailed instructions, see building the FPGA and device tree details.
Build device tree compiler (optional)
If you need the Device Tree Compiler with overlay patches:
sudo apt-get install flex bison
git clone git@github.com:pantoniou/dtc.git
cd dtc
git checkout overlays
make
sudo make install PREFIX=/usr
Note
A pre-compiled binary is available in the tools/dtc directory.
Build U-Boot
Build U-Boot binary and boot scripts:
make -f Makefile.x86 boot
This downloads the Xilinx U-Boot source from GitHub, applies Red Pitaya patches (from patches/ directory), and builds.
Note
Two versions of boot.bin are created:
One for boards with 512 MB RAM
One for boards with 1 GB RAM
Two versions of Linux kernel boot scripts are also created.
Note
The device tree for U-Boot is built using files from the dts_uboot/ folder, defining minimum peripheral requirements for board startup.
Build U-Boot binary and boot scripts:
make -f Makefile.x86 u-boot
This downloads the Xilinx U-Boot source from GitHub, applies Red Pitaya patches (from patches/ directory), and builds.
Build Linux kernel and device tree binaries
Build the Linux kernel and device tree:
make -f Makefile.x86 linux
make -f Makefile.x86 devicetree
This downloads the Xilinx Linux kernel source from GitHub, applies Red Pitaya patches (from patches/ directory), and builds.
Note
Device tree builds require FPGA projects to be built first, as dtb and dts files are based on FPGA barebone projects.
Build the Linux kernel and device tree binaries:
make -f Makefile.x86 linux
make -f Makefile.x86 linux-install
make -f Makefile.x86 devicetree
make -f Makefile.x86 devicetree-install
This downloads the Xilinx Linux kernel source from GitHub, applies Red Pitaya patches (from patches/ directory), and builds.
Build boot file
Create the boot file containing FSBL, FPGA bitstream, and U-Boot:
make -f Makefile.x86 boot
Build user-space applications
Build individual components in the ARM chroot environment:
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make api
make nginx
make scpi
make sdr
make bode
make monitor
make generator
make acquire
make calib
make daisy_tool
make spectrum
make led_control
make ecosystem
make updater
make main_menu
make scpi_manager
make streaming_manager
make calib_app
make network_manager
make jupyter_manager
EOL_CHROOT
Note
Some components have dependencies on each other. Use make all to build everything at once.
Component-Specific Information
The following sections provide additional details for specific components.
API library
Build the Red Pitaya API library:
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make api
EOL_CHROOT
Output files:
Library:
api/lib/librp.soHeader file:
api/includes/redpitaya/rp.h
Install to Red Pitaya:
scp build/api/lib/*.so root@192.168.0.100:/opt/redpitaya/lib/
Replace 192.168.0.100 with your Red Pitaya’s IP address (or use the .local address).
U-Boot EEPROM configuration
U-Boot variables are stored in EEPROM but are not read automatically during boot. Default constant values are used if EEPROM is not read.
To update and recalculate variable values from EEPROM:
i2c dev 0
# Offset 0x1800 + 0x4 (crc32)
eeprom read 0 0x50 0 0x1804 0x400
env import -b 0 0x400 hw_rev serial ethaddr
SCPI server
Build the SCPI server:
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make scpi
EOL_CHROOT
Output file: scpi-server/scpi-server
Install to Red Pitaya:
scp scpi-server/scpi-server root@192.168.0.100:/opt/redpitaya/bin/
Replace 192.168.0.100 with your Red Pitaya’s IP address (or use the .local address).
Note
Red Pitaya uses a customized SCPI parser with optimized functions for Red Pitaya hardware.
For more information, see the SCPI server README.
Legacy web applications
To build applications from the apps-free directory, follow the instructions in the repository.
Warning
Applications in apps-free were developed for Ecosystem 1.04 and earlier. They require modification to work with Ecosystem 2.00 and higher.