Sunday 29 October 2017

Building the PlutoSDR Firmware Image

Building the PlutoSDR Firmware Image

This is done on a Ubuntu 17.10

Attention: At the moment the build fails under Ubuntu 17.10, because of the flex package.

>>> host-flex 2.6.4 Building
PATH="/home/dimce/src/plutosdr-bsp/buildroot/output/host/bin:/home/dimce/src/plutosdr-bsp/buildroot/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/Xilinx/SDK/2017.2/gnu/arm/lin/bin" PKG_CONFIG="/home/dimce/src/plutosdr-bsp/buildroot/output/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/dimce/src/plutosdr-bsp/buildroot/output/host/lib/pkgconfig:/home/dimce/src/plutosdr-bsp/buildroot/output/host/share/pkgconfig"  /usr/bin/make -j9  -C /home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/
make[2]: Entering directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4'
Making all in src
make[3]: Entering directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/src'
/usr/bin/make  all-am
make[4]: Entering directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/src'
./stage1flex   -o stage1scan.c ./scan.l
Makefile:1688: recipe for target 'stage1scan.c' failed
make[4]: *** [stage1scan.c] Segmentation fault (core dumped)
make[4]: Leaving directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/src'
Makefile:538: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/src'
Makefile:526: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4'
package/pkg-generic.mk:227: recipe for target '/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/.stamp_built' failed
make[1]: *** [/home/dimce/src/plutosdr-bsp/buildroot/output/build/host-flex-2.6.4/.stamp_built] Error 2
make[1]: Leaving directory '/home/dimce/src/plutosdr-bsp/buildroot'
Makefile:36: recipe for target 'buildroot/output/images/rootfs.cpio.gz' failed
make: *** [buildroot/output/images/rootfs.cpio.gz] Error 2

Xilinx Toolchain

Download the latest version (2017.2 at the moment!) of Vivado which will be used for writing/editing/modelising/whatever all the files. You need to download a Full Installer, whenever it's a Web installer or not (depends of the amount of free space you have). You can download it there.


Download a WebPack License on the Licensing Site (From "node-locked" part).


Installing Vivado

Prepare the install directory

$ sudo mkdir /opt/Xilinx
$ sudo chown <user-name> /opt/Xilinx
$ chmod u+rwX /opt/Xilinx

Go to the folder where you downloaded the installer

$ chmod +x ./Xilinx_Vivado_SDK_2017.2_0616_1_Lin64.bin
$ ./Xilinx_Vivado_SDK_2017.2_0616_1_Lin64.bin


Follow the installation wizard and don’t forget to select “Software Development Kit” on the installation customization page. (Vivado System Edition + SDK)




If you have to choose which boards you want to install, you can choose to install everything, it's the best way for not forgetting anything... Or choose to install all the tools and only the Zynq 7 board.
If not, it's just perfect isn't it?

Import your license

Launching Vivado

Source the architecture shell file:

$ source /opt/Xilinx/Vivado/2017.2/settings64.sh

Then launch it:

$ ./bin/vivado

Linux development host


Prepare the host

$ sudo apt-get install git make u-boot-tools build-essential fakeroot libncurses5-dev libssl-dev ccache dfu-util mtools util-linux

Genimage tool


Get and install from here.

Install additional package:

$ sudo apt-get install libconfuse-common libconfuse-dev libconfuse1
1. Download
2. Extract

$ ./configure
$ make
$ sudo make install

Build Instructions

cd src
git clone https://github.com/PlutoSDR/plutosdr-bsp.git
cd plutosdr-bsp
export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
export PATH=$PATH:/opt/Xilinx/SDK/2017.2/gnu/arm/lin/bin
make git-update-all
make update
make


Updating your local repository

make git-pull

Updating buildroot config (zynq_pluto_defconfig file)

make update-buildroot-config

Updating buildroot third-party packages (packages directory)

make update-buildroot-packages





PlutoSDR Notes

PlutoSDR Notes

Serial Port to PlutoSDR

$ screen /dev/ttyUSB0 96000
User name is: root
Password is: analog

Enable dual-core on plutosdr

Commands to perform on PlutoSDR:

# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 666.66
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

Hardware : Xilinx Zynq Platform
Revision : 0003
Serial : 0000000000000000
does show a single core CPU

# fw_setenv maxcpus
# pluto_reboot reset

# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 666.66
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

processor : 1
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 666.66
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

Hardware : Xilinx Zynq Platform
Revision : 0003
Serial : 0000000000000000

Enable dual-core on plutosdr

Hack RX range from 300 MHz - 3.8 GHz to reach 70 MHz to 6 GHz

Commands to perform on PlutoSDR:

# fw_setenv attr_name compatible
# fw_setenv attr_val ad9364
# pluto_reboot reset

GQRX on Ubuntu 17.10

This is done from a fresh install of Ubuntu that is updated with sudo apt-get update and sudo apt-get upgrade. First lets do a little preparatory work from the terminal.

sudo apt-get install git cmake rtl-sdr librtlsdr0 librtlsdr-dev miri-sdr libmirisdr0 libmirisdr-dev

Now for GQRX
sudo add-apt-repository -y ppa:bladerf/bladerf
sudo add-apt-repository -y ppa:ettusresearch/uhd
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:myriadrf/gnuradio
sudo add-apt-repository -y ppa:gqrx/gqrx-sdr
sudo apt-get update
sudo apt-get install gqrx-sdr gr-iio

Now that is done. Lets install the upstream driver for gr-osmosdr which has PlutoSDR included.

mkdir src
sd src
git clone https://github.com/csete/gr-osmosdr-gqrx
cd gr-osmosdr-gqrx/
git checkout plutosdr
mkdir build
cd build/
cmake ../
make
sudo make install
sudo ldconfig
Now when you open GQRX and have your PlutoSDR plugged in it should show up. You Done Did It.