**** THIS SETUP GUIDE Works with the kernel driver implementation only ****
**** This setup guide was broken by libusb transition. You must use libusb for now. ****
**** LIBUSB implementation setup guide to come soon. ****
*******************************************************************************************
Please use: for setups now..
http://forum.nuand.com/forums/viewtopic.php?f=9&t=2992
----- OLD STUFF Below -----
The gnuradio build instruction I think are still valid..
This is a quick guide I put together for setup the bladeRF on a (?)ubuntu 13.04 AMD64 system.
These instructions are not well tested at this time, feedback and corrections are welcome..
Someone was talking about converting this into a script one could just run.
I just got my board in, and the setup instructions I found to be a bit scattered brain.. So this is an attempt to consolidate the knowledge.
*******************************************************************************************
**** THIS SETUP GUIDE Works with the kernel driver implementation only ****
**** LIBUSB implementation setup guide to come soon. ****
*******************************************************************************************
Change List:
8/5/2013 : based on suggestions from lousyg
corrected missing ../ on cmake
added updated information about redhat based distros..
8/7/2013
Correct init_board.sh script to only load the FPGA
Once the FX3 flash has been loaded, you don't need to touch it, unless there is an upgraded flash image.
8/18/2013
Fixed some typos.
------- START ------------------------------
Pete's BladeRF build/install instructions (as of 8/3/2012): tested (k)ubuntu 13.04 linux-3.8.0-27-generic x86_64
Peter Fetterer (kb3gtn) <[email protected]>
This procedure builds the nuand code / FX3 firmware / builds gnuradio-3.7 (from git) / and gr-osmosdr (from git)
It is assumed you have installed build-essential / linux-headers-`uname -r` and have a general idea of figuring out other missing (apt-getable) depends.
In this example install procedure we will be installing everything into a /opt/[bladeRF]|[cypress]|[gnuradio-3.7.1git]
Because of the custom location, it does require us to update libarary search paths / and pythonpath enviroments / and optionally exec path. (covered here)
This procedure is tailored to ubuntu systems, but could be adapted to other distros like Centos / Gentoo etc...
*** Now to build the Nunad software ***
Make a directory in your home directory called ~/sandbox
We will be doing all our builds in here..
Clone the Nuand repository to your box.
Code: Select all
$ git clone https://github.com/ ./bladeRf/
Code: Select all
$ cd ~/sandbox/bladeRF/linux/kernel
Code: Select all
$ make
Now to install it (manually)
Code: Select all
$ sudo mkdir -p /lib/modules/`uname -r`/kernel/extras/bladeRF/
$ sudo cp bladeRF.ko /lib/modules/`uname -r`/kernel/extras/bladeRF/
$ sudo depmod
$ sudo modprobe bladeRF
Code: Select all
$ sudo -s
# echo "bladeRF" >> /etc/modules
# exit
Code: Select all
$ cd ~/sandbox/bladeRF/linux/lib/
$ make DEBUG=y
$ sudo make install
Now build the bladeRF-cli program
(Need to install prereq libtecla1 libtecla1-dev)
Code: Select all
$ sudo apt-get install libtecla1 libtecla1-dev
$ cd ~/sandbox/bladeRF/linux/apps
$ make
Code: Select all
$ sudo mkdir -p /opt/bladeRF/fpga
$ sudo mkdir /opt/bladeRF/firmware
$ sudo mkdir /opt/bladeRF/bin
# manually install bin into our custom directory structure.
$ sudo cp bin/bladeRF-cli /opt/bladeRF/bin
You will need to go and download the FX3 toolchain and sources from: http://www.cypress.com/?rID=57990
( This requires you to get an account and download a 300 Mb tarball.. sigh.. )
or you can skip this step and use this known good firmware: (Thanks Brian)
FX3 Image: http://www.nuand.com/~bpadalino/bladeRF.img
FX3 Image MD5sum: 34c158b08f89f7cec614f2fc603f0e6b
FPGA Image that matches: http://nuand.com/fpga/f6c6a3abcb22d2794 ... tedx40.rbf
Setup cypress FX3 build environment and toolchain stuff
Code: Select all
$ sudo mkdir -p /opt/cypress/fx3_sdk
$ cd /opt/cypress/fx3_sdk
$ sudo tar -xvzf <download/path>/FX3_SDK_B125.tar.gz ./
$ sudo tar -xvzf ARM_GCC.tgz
$ sudo tar -xvzf cyusb_linux_1.0.3.tar.gz
$ sudo tar -xvzf FX3_Firmware.tar.gz
Now to build the FX3 firmware for the BladeRF
Code: Select all
$ cd ~/sandbox/baldeRf/fx3_firmware
$ cp ./make/toolchain.mk.sample ./make/toolchain.mk
$ make DEBUG=yes
(manual install)
Code: Select all
$ sudo cp bladeRF.img /opt/bladeRf/firmware/
(This is an optional step, you can allways run init_board.sh manually.)
with you favorite text editor create this new file (needs sudo) (vim in my case )
Code: Select all
$ sudo vi /etc/udev/rules.d/10-bladerf.rules
mode could be set to a more restrictive 0660 and then add a GROUP:="plugdev" to constrained access to it, for the more security conscious.SUBSYSTEM=="usbmisc", KERNEL=="bladerf*", MODE:="0666", RUN+="/opt/bladeRF/init_board.sh $tempnode"
Now create a init_board.sh script
Code: Select all
$ sudo vi /opt/bladeRF/init_board.sh
Make the new script we made executable.#!/bin/bash
# get configuration variables
source /opt/bladeRF/etc/bladeRF.cfg
#Once firmware is loaded. you don't need to do it again, unless your updating it. Its flashed onto the FX3..
#echo "Loading new bladeRF device at $1 with firmware ${firmware_image} and fpga ${fpga_image}"
#/opt/bladeRF/bin/bladeRF-cli -b -d $1 -f ${firmware_image} -l ${fpga_image}
# use this instead..
echo "Loading new bladeRF device at $1 with fpga ${fpga_image}"
/opt/bladeRF/bin/bladeRF-cli -b -d $1 -l ${fpga_image}
echo "Complete."
Code: Select all
$ sudo chmod +x /opt/bladeRF/init_board.sh
Code: Select all
$ sudo vi /opt/bladeRF/etc/bladeRF.cfg
you might want to change the hostedx40.rbf with hostedx115.rbf if you have the fancier board.#!/bin/bash
# This file gets sourced for configuration information variables.
# This a configuration information file about what firmware and fpga image to load
# TODO: figure out how to tell the difference between board types and change what FPGA to load...
# For Now: simple fix configuration.
firmware_image=/opt/bladeRF/firmware/bladeRF.img
fpga_image=/opt/bladeRF/fpga/hostedx40.rbf
export firmware_image fpga_image
*** Building GNURADIO from GIT ***
Code: Select all
$ cd ~/sandbox
$ mkdir gnuradio-builds
$ cd gnuradio-builds
$ wget http://www.sbrac.org/files/build-gnuradio
$ chmod +x ./build-gnuradio.sh
$ ./build-gnuradio.sh -m prereqs gitfetch
Code: Select all
$ 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
Code: Select all
$ sudo make install
With your favorite text editor.. ( vim ) create a new file call /etc/profile.d/gnuradio.sh
you will need sudo for this...
Code: Select all
sudo vi /etc/profile.d/gnuradio.sh
update path above if you deviated from gnuradio-3.7.1git#!/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/dist-packages
else
export PYTHONPATH=/opt/gnuradio-3.7.1git/lib/python2.7/dist-packages
fi
If your on some non-debian based distro, you might need to replace "dist-packages" with "site-packages".
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)
Code: Select all
$ sudo vi /etc/ld.so.conf.d/gnuradio.conf
(note:) on some 64 bit systems, you might need a lib64 directory in this file as well?/opt/gnuradio-3.7.1git/lib
now update your library cache:
Code: Select all
$ sudo ldconfig -v | grep gnuradio
If so.. All is good./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
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.
*** Now for gr-osmosdr ***
Now pull the git version of gr-osmosdr
Code: Select all
$ cd ~/sandbox
$ git clone git://git.osmocom.org/gr-osmosdr ./gr-osmosdr
$ mkdir ~/sandbox/gr-osmosdr/build
$ cd ~/sandbox/gr-osmosdr/build
$ cmake -DCMAKE_INSTALL_PREFIX=/opt/gnuradio-3.7.1git ../ (change as needed)
$ make
$ sudo make install
*** Now for the Fun part, playing with the new toy ****
***************************************************************
you can use bladeRF-CLI to control board parameters.
https://github.com/Nuand/bladeRF/tree/b ... a-setuptxt
you can use the osmocom_siggen and osmocom_fft applications located in /opt/gnuradio-3.7.1git/bin/ to do a FFT spectrum and signal generation.
You can now use gnuradio to build and receive signals. use the osmocom sink and sources block.
Have fun, happy hacking..