Giter Site home page Giter Site logo

sanpii / redpitaya Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redpitaya/redpitaya

0.0 2.0 0.0 133.99 MB

Red Pitaya Ecosystem and Applications

License: Other

Makefile 0.96% TeX 0.09% C 70.21% C++ 1.22% Shell 2.33% MATLAB 1.45% Mercury 0.01% Assembly 0.24% HTML 7.09% CSS 1.63% JavaScript 6.20% Nginx 0.29% Tcl 2.16% Verilog 1.66% SystemVerilog 3.51% Lua 0.02% Objective-C 0.74% Python 0.18%

redpitaya's Introduction

Red Pitaya ecosystem and applications

Here you will find the sources of various software components of the Red Pitaya system. The components are mainly contained in dedicated directories, however, due to the nature of the Xilinx SoC "All Programmable" paradigm and the way several components are interrelated, some components might be spread across many directories or found at different places one would expect.

directories contents
api librp.so API source code
api2 librp2.so API source code
Applications WEB applications (controller modules & GUI clients).
apps-free WEB application for the old environment (also with controller modules & GUI clients).
apps-tools WEB interface home page and some system management applications
Bazaar Nginx server with dependencies, Bazaar module & application controller module loader.
fpga FPGA design (RTL, bench, simulation and synthesis scripts)
fpga2 FPGA design (RTL, bench, simulation and synthesis scripts) SystemVerilog based for newer applications
OS/buildroot GNU/Linux operating system components
patches Directory containing patches
scpi-server SCPI server
Test Command line utilities (acquire, generate, ...), tests
shared libredpitaya.so API source code (to be deprecated soon hopefully!)

Supported platforms

Red Pitaya is developed on Linux, so Linux (preferably 64bit Ubuntu) is also the only platform we support.

Software requirements

You will need the following to build the Red Pitaya components:

  1. Various development packages:
# generic dependencies
sudo apt-get install make curl xz-utils
# U-Boot build dependencies
sudo apt-get install libssl-dev device-tree-compiler u-boot-tools
# secure chroot
sudo apt-get install schroot
# QEMU
sudo apt-get install qemu qemu-user qemu-user-static
  1. Xilinx Vivado 2016.2 FPGA development tools. The SDK (bare metal toolchain) must also be installed, be careful during the install process to select it. Preferably use the default install location.

  2. Missing gmake path

Vivado requires a gmake executable which does not exist on Ubuntu. It is necessary to create a symbolic link to the regular make executable.

sudo ln -s /usr/bin/make /usr/bin/gmake

Build process

Go to your preferred development directory and clone the Red Pitaya repository from GitHub.

git clone https://github.com/RedPitaya/RedPitaya.git
cd RedPitaya

An example script settings.sh is provided for setting all necessary environment variables. The script assumes some default tool install paths, so it might need editing if install paths other than the ones described above were used.

. settings.sh

Prepare a download cache for various source tarballs. This is an optional step which will speedup the build process by avoiding downloads for all but the first build. There is a default cache path defined in the settings.sh script, you can edit it and avoid a rebuild the next time.

mkdir -p dl
export DL=$PWD/dl

Download the ARM Ubuntu root environment (usually the latest) from Red Pitaya download servers. You can also create your own root environment following instructions in [OS/debian/README.md]. Correct file permissions are required for schroot to work properly.

wget http://downloads.redpitaya.com/ubuntu/redpitaya_ubuntu-latest.tar.gz
sudo chown root:root redpitaya_ubuntu-latest.tar.gz
sudo chmod 664 redpitaya_ubuntu-latest.tar.gz

Create schroot configuration file /etc/schroot/chroot.d/red-pitaya-ubuntu.conf. Replace the tarball path stub with the absolute path of the previously downloaded image. Replace user names with a comma separeted list of users whom should be able to compile Red Pitaya.

[red-pitaya-ubuntu]
description=Red Pitaya Debian/Ubuntu OS image
type=file
file=absolute-path-to-red-pitaya-ubuntu.tar.gz
users=comma-seperated-list-of-users-with-access-permissions
root-users=comma-seperated-list-of-users-with-root-access-permissions
root-groups=root
profile=desktop
personality=linux
preserve-environment=true

To build everything a few make steps are required.

make -f Makefile.x86
schroot -c red-pitaya-ubuntu <<- EOL_CHROOT
make -f Makefile CROSS_COMPILE="" REVISION=$GIT_COMMIT_SHORT
EOL_CHROOT
make zip

To get an itteractive ARM shell do:

schroot -c red-pitaya-ubuntu

Partial rebuild process

The next components can be built separately.

  • FPGA + device tree
  • u-Boot
  • Linux kernel
  • Debian/Ubuntu OS
  • API
  • SCPI server
  • free applications

Base system

Here base system represents everything before Linux user space.

To be able to compile FPGA and cross compile base system software, it is necessary to setup the Vivado FPGA tools and ARM SDK.

$ . settings.sh

On some systems (including Ubuntu 16.04) the library setup provided by Vivado conflicts with default system libraries. To avoid this disable library overrides specified by Vivado.

$ export LD_LIBRARY_PATH=""

After building the base system it can be installed into the directory later used to create the FAT filesystem compressed image.

$ make -f Makefile.x86 install

FPGA and device tree sources

$ make -f Makefile.x86 fpga

Detailed instructions are provided for building the FPGA including some device tree details.

U-boot

To build the U-Boot binary and boot scripts (used to select between booting into Buildroot or Debian/Ubuntu):

make -f Makefile.x86 u-boot

The build process downloads the Xilinx version of U-Boot sources from Github, applies patches and starts the build process. Patches are available in the patches/ directory.

Linux kernel and device tree binaries

To build a Linux image:

make -f Makefile.x86 linux
make -f Makefile.x86 linux-install
make -f Makefile.x86 devicetree
make -f Makefile.x86 devicetree-install

The build process downloads the Xilinx version of Linux sources from Github, applies patches and starts the build process. Patches are available in the patches/ directory.

Boot file

The created boot file contains FSBL, FPGA bitstream and U-Boot binary.

make -f Makefile.x86 boot

Linux user space

Debian/Ubuntu OS

Debian/Ubuntu OS instructions are detailed elsewhere.

API

To compile the API run:

make api

The output of this process is the Red Pitaya librp.so library in api/lib directory. The header file for the API is redpitaya/rp.h and can be found in api/includes. You can install it on Red Pitaya by copying it there:

scp api/lib/librp.so [email protected]:/opt/redpitaya/lib/

SCPI server

Scpi server README can be found here.

To compile the server run:

make api

The compiled executable is scpi-server/scpi-server. You can install it on Red Pitaya by copying it there:

scp scpi-server/scpi-server [email protected]:/opt/redpitaya/bin/

Free applications

To build free applications, follow the instructions given at apps-free/README.md file.

redpitaya's People

Contributors

alesb avatar aljosamrak avatar andreysolovev avatar bborut avatar cimem avatar dakus avatar drws avatar funkyclown avatar hrrossi avatar jeras avatar jjmz avatar katjasuvajac avatar melko avatar na1pir avatar pdorazio avatar qwe2tz avatar sanpii avatar simonpw avatar tomazj avatar zwelab avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.