title:BladerRF quick quide keywords:sdr,bladerf,gnuradio,gqrx # BladeRF quick guide ## Intro BladeRF is SDR device capable to transmit in range 47-6000Mhz and receive in range 70-6000Mhz. With samplerate 0.52-61Mhz and max bandwidth 0.2-56MHz. As it capable to RX/TX on quite wide range there is infinite possibilities what can be done with it. ## Quick test Run ```bash bladeRF-cli -p ``` Output will show if any BladeRF device is connected ## Running GQRX Lunch any of command below to start graphical SDR ```bash gqrx gqrx-alsa //if first one fails with some pulse audio error ``` Choose device selection dialog and add to __Device string__ ```bash bladerf=0,fpga=/usr/share/bladerf/fpga/hostedxA4.rbf ``` This will set to first bladerf and load FPGA bitstream, find path to bitstream on your PC from distro package. Now GQRX will ready to go ### Enable biastee If there are attached LNA or LNB to BladeRF SMA ports you can enable biastee by adding to GQRX __Device string__ with comma separation between parameters ```bash biastee=rx ``` ## Running from command line To start interactive commandline point to fpga bitstream, can be found in distro package. ```bash bladeRF-cli -i -l /usr/share/bladerf/fpga/hostedxA4.rbf ``` ### Receive Set frequency to AA Megaherz with sample rate BB bandwidth CC and write to file DD in signed complex 16 bit, with 20M entries ```bash set frequency rx AAM set samplerate rx BBM set bandwidth rx CCM rx config file=DD.sc16q11 format=bin n=20M rx start rx wait rx ``` ### Transmit Set frequency to AA Megaherz with sample rate BB bandwidth CC and read from file DD in signed complex 16 bit ```bash set frequency tx AAM set samplerate tx BBM set bandwidth tx CCM tx config file=DDsc16q11 format=bin tx start tx wait tx ``` ### Enable biastee To enable/disable biastee set channel RX1/RX2/TX1/TX2 to 0/false to disable and 1/true to enable biastee on particular channel ```bash set biastee RX1 true ``` ## Gnuradio Gnuradio is opensource tool that allows you to utilize DSP blocks and create processing pipeline. It works like a block diagrams drawing tool, except the block are DSP processing steps and as output you get processed signal. Here is example how to create FM radio listening design and as result you can hear to your local radio stations. ![BladerRF fm radio block diagram](/img/gnuradio/bladerf_fm_radio.png) ## Quartus Steps how to install Quartus and make it compile BladeRF firmware Get the version of Quartus 20.1.1 from Intel download page. Get the whole package or 2 packates Quartus,ModelSim and CycloneV device support package. Install the Quartus. Get the BladeRF source: ``` git clone https://github.com/Nuand/bladeRF.git cd bladeRF git submodule init git submodule update ``` go to *hdl/quartus* so now set the environment ``` export QSYS_ROOTDIR="/home/user/intelFPGA_lite/20.1.1/quartus/sopc_builder" export QUARTUS_ROOTDIR=/home/user/intelFPGA_lite/20.1.1/quartus export PATH=$PATH:/home/user/intelFPGA_lite/20.1.1/quartus/sopc_builder/bin export PATH=$PATH:/home/user/intelFPGA_lite/20.1.1/quartus/bin export PATH=$PATH:/home/user/intelFPGA_lite/20.1.1/nios2eds/bin export PATH=$PATH:/home/user/intelFPGA_lite/20.1.1/nios2eds/sdk2/bin export PATH=$PATH:/home/user/intelFPGA_lite/20.1.1/nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/bin/ export SOPC_KIT_NIOS2=/home/user/intelFPGA_lite/20.1.1/nios2eds ``` Get the license files from Intel self licensing page ``` export LM_LICENSE_FILE=/home/user/intelFPGA_lite/LR-174976_License.dat export MGLS_LICENSE_FILE=/home/user/intelFPGA_lite/LR-174976_License.dat ``` Now in bladerf dir go to hdl/quartus and run command to build hosted firmware ``` ./build_bladerf.sh -b bladeRF-micro -r hosted -s A4 ``` ## Modsim How to make modsim to run, for simulating BladeRF code Add dependencies for modsim ``` dpkg --add-architecture i386 apt update apt install libxft2 libxft2:i386 libxext6 libext6:i386 ``` Run vsim command from where its located inside the quartus install directory ``` ./vsim ``` ## Links [https://www.nuand.com/bladerf-2-0-micro/](https://www.nuand.com/bladerf-2-0-micro/) [https://gqrx.dk/](https://gqrx.dk/) [https://www.nuand.com/product/bt-100/](https://www.nuand.com/product/bt-100/) [https://www.nuand.com/product/bt-200/](https://www.nuand.com/product/bt-200/) [https://github.com/Nuand/bladeRF/wiki/bladeRF-CLI-Tips-and-Tricks](https://github.com/Nuand/bladeRF/wiki/bladeRF-CLI-Tips-and-Tricks) [https://sites.google.com/site/sdrbladerf/home/bladerf-getting-started](https://sites.google.com/site/sdrbladerf/home/bladerf-getting-started) [https://www.gnuradio.org/](https://www.gnuradio.org/) [https://github.com/Nuand/bladeRF/wiki/Getting-Started%3A-Linux#user-content-Debianbased_distros_eg_Ubuntu](https://github.com/Nuand/bladeRF/wiki/Getting-Started%3A-Linux#user-content-Debianbased_distros_eg_Ubuntu)