Skip to content
Joseph Hajduk edited this page Sep 5, 2013 · 9 revisions

Table of Contents

Redhat based Distro setup guide

This guide needs work..

  • Build Process Overview
  1. Build libusb tools and libraries from Nuand GIT Master
  2. Building GNURADIO from GIT
  3. Build for gr-osmosdr
  4. Simple test applications to verify device operation

Build libusb tools and libraries from Nuand GIT Master

  • Clone the libusb support branch to your system
git clone https://github.com/Nuand/bladeRF.git ./bladeRF
  • Install dependent packages for the build
sudo yum install <libusb-1.0-0 with dev, compiler tools, cmake, libncurses5 with dev> 
  • building the libusb stuff
cd <git_base_dir>/hosts/
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DINSTALL_UDEV_RULES=ON -DCMAKE_INSTALL_PREFIX=/opt/bladeRF/ ../
make
sudo make install
  • Update library paths
sudo vi /etc/ld.so.conf.d/bladeRF.conf
/opt/bladeRF/lib/
now run "sudo ldconfig" to update library paths
  • Initial firmware loading & fpga loading procedure
Assuming you added /opt/bladeRF/bin to your path or system path. (not covered here, just google it.. ) See if you can detect your bladeRF:
bladerf-cli -p
Should return something that looks like:
    Backend: libusb
    Serial: <Not yet supported> or < SN Number >  Depends on FPGA image.
    USB Bus: 6
    USB Address: 4

Then load the FX3 firmware. Note: you only need to do this once.. It's stored in flash, and survives power cycling. The FPGA image, needs to be loaded every time.

bladerf-cli -f <firmware.img>
Load FPGA
bladerf-cli -l <fpga.rbf>

NOTE: For the FPGA image, there are 2 different sizes. The 40kLE FPGA image will only work with the x40 and the 115kLE FPGA image will only work with the x115. If you see the number `40` or `115` on the large Altera FPGA, you know which FPGA you have. If you have doubts and the FPGA times out during loading, try the other image.

Recommended firmware and FPGA images to use
FX3 Image: http://nuand.com/fx3/latest.img
FPGA: http://nuand.com/fpga

The BladeRF at this point should be ready to go.. Now you just need something to talk to it.. GNURadio is a good candidate..

Building GNURADIO from GIT

  • Use gnuradio-build to pull and check dependencies
cd ~/sandbox
mkdir gnuradio-builds
cd gnuradio-builds
wget http://www.sbrac.org/files/build-gnuradio
chmod +x ./build-gnuradio
./build-gnuradio -m prereqs gitfetch
This takes a while... check top, seems like it sits a long time on checking pre-requisits with no output.
  • Compile GNU Radio
cd ~/sandobx/gnuradio-builds/gnuradio/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/gnuradio-3.7.1git  ../ (based on git release, change as needed)
make
( This is a large build and will take some time.. good time to take a break..)
sudo make install
  • Add GNU Radio to linker path and executable path
create a new file call /etc/profile.d/gnuradio.sh you will need sudo for this.
sudo vi /etc/profile.d/gnuradio.sh

Put the following into it:

#!/bin/bash
# add gnuradio and bladerf stuff to path
export PATH=$PATH:/opt/gnuradio-3.7.1git/bin:/opt/bladeRF/
# add gnuradio python libraries to python search path
if [ $PYTHONPATH ]; then
        export PYTHONPATH=$PYTHONPATH:/opt/gnuradio-3.7.1git/lib/python2.7/site-packages
else
        export PYTHONPATH=/opt/gnuradio-3.7.1git/lib/python2.7/site-packages
fi
note: update path above if you deviated from gnuradio-3.7.1git

Again, with your favorite text editor, create a new file call /etc/ld.so.conf.d/gnuradio.conf you will need sudo for this again.. (one line file)

sudo vi /etc/ld.so.conf.d/gnuradio.conf
Put this in the new file:
/opt/gnuradio-3.7.1git/lib
(note:) on some 64 bit systems, you might need a lib64 directory in this file as well?
  • now update your library cache
 sudo ldconfig -v | grep gnuradio

should see this or something similar..

/opt/gnuradio-3.7.1git/lib:
        libgnuradio-atsc-3.7.1git.so.0.0.0 -> libgnuradio-atsc.so
        libgnuradio-trellis-3.7.1git.so.0.0.0 -> libgnuradio-trellis.so
        libgnuradio-analog-3.7.1git.so.0.0.0 -> libgnuradio-analog.so
        libgnuradio-pager-3.7.1git.so.0.0.0 -> libgnuradio-pager.so
        libgnuradio-vocoder-3.7.1git.so.0.0.0 -> libgnuradio-vocoder.so
        libgnuradio-video-sdl-3.7.1git.so.0.0.0 -> libgnuradio-video-sdl.so
        libgnuradio-pmt-3.7.1git.so.0.0.0 -> libgnuradio-pmt.so
        libgnuradio-noaa-3.7.1git.so.0.0.0 -> libgnuradio-noaa.so
        libgnuradio-filter-3.7.1git.so.0.0.0 -> libgnuradio-filter.so
        libgnuradio-digital-3.7.1git.so.0.0.0 -> libgnuradio-digital.so
        libgnuradio-channels-3.7.1git.so.0.0.0 -> libgnuradio-channels.so
        libgnuradio-qtgui-3.7.1git.so.0.0.0 -> libgnuradio-qtgui.so
        libgnuradio-wxgui-3.7.1git.so.0.0.0 -> libgnuradio-wxgui.so
        libgnuradio-fec-3.7.1git.so.0.0.0 -> libgnuradio-fec.so
        libgnuradio-wavelet-3.7.1git.so.0.0.0 -> libgnuradio-wavelet.so
        libgnuradio-fcd-3.7.1git.so.0.0.0 -> libgnuradio-fcd.so
        libgnuradio-blocks-3.7.1git.so.0.0.0 -> libgnuradio-blocks.so
        libgnuradio-fft-3.7.1git.so.0.0.0 -> libgnuradio-fft.so
        libgnuradio-runtime-3.7.1git.so.0.0.0 -> libgnuradio-runtime.so
        libgnuradio-audio-3.7.1git.so.0.0.0 -> libgnuradio-audio.so
If so.. All is good.

you will now need to logout and log back in for the profile.d settings to take effect. Once you have logged back in to your desktop, you should be able to run gnuradio-companion. If you get a pop up about PYTHONPATH or LD_LIBRARY_PATH, check env to see if the python path or ldconfig returns the correct libraries.

Build for gr-osmosdr

  • Pull the git version of gr-osmosdr, build, install
$ cd ~/sandbox
$ git clone git://git.osmocom.org/gr-osmosdr ./gr-osmosdr
$ mkdir ~/sandbox/gr-osmosdr/build
$ cd ~/sandbox/gr-osmosdr/build
$ cmake -DLIBBLADERF_PKG_INCLUDE_DIRS=/opt/bladeRF/include/ -DLIBBLADERF_PKG_LIBRARY_DIRS=/opt/bladeRF/lib/ -DCMAKE_INSTALL_PREFIX=/opt/gnuradio-3.7.1git ../  (change as needed)
$ make
$ sudo make install

Simple test applications to verify device operation

  • Using osmocom stand-alone applictions:
Test Receive: (446 MHz)
osmocom_fft -s 8000000 -f 446000000 -g 60
Test Transmit: (446 MHz + 25 KHz )
osmocom_siggen -s 8000000 -f 446000000 -g 4 --sine -x 25000

{ MORE TO COME }