moving targets/ARCH to sdr/
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
BladeRF documentation
|
||||
=====================
|
||||
|
||||
As of 2018-11-06, the bladeRF support is not fully automatic and requires
|
||||
some manual settings before use. This documentation is the ultimate source
|
||||
of information. If something described in this file does not work or does
|
||||
not correspond to the reality, then contact us so we can fix the problems
|
||||
and update this documentation.
|
||||
|
||||
1. Install bladeRF 2.0 libraries.
|
||||
|
||||
As of now, it's better to install from source.
|
||||
So, do not run: ./build_oai -I -w BLADERF
|
||||
(That is: do not include '-w BLADERF'.)
|
||||
|
||||
Instead, follow the instructions at: https://github.com/Nuand/bladeRF
|
||||
|
||||
If you already had some bladeRF software installed using automatic
|
||||
methods, first remove it by hand ('apt-get purge bladeRF' or something
|
||||
similar, you can get the list of installed bladeRF packages by running
|
||||
'dpkg -l|grep -i blade', remove them all).
|
||||
|
||||
2. Update the device.
|
||||
|
||||
Download the latest FX3 firmware and FPGA images from Nuand's website.
|
||||
As of writing, this is:
|
||||
|
||||
https://github.com/Nuand/bladeRF/wiki
|
||||
|
||||
That points to the following pages.
|
||||
For FX3:
|
||||
|
||||
http://www.nuand.com/fx3_images/
|
||||
|
||||
For FPGA:
|
||||
|
||||
http://www.nuand.com/fpga_images/
|
||||
|
||||
Install FX3 firmware:
|
||||
|
||||
sudo bladeRF-cli -f bladeRF_fw_latest.img
|
||||
|
||||
Install FPGA image (this is for BladeRF x40):
|
||||
|
||||
sudo bladeRF-cli -L hostedx40-latest.rbf
|
||||
|
||||
Retrieve calibration information:
|
||||
|
||||
sudo bladeRF-cli -i
|
||||
info
|
||||
|
||||
That outputs the serial number of your device.
|
||||
|
||||
Go to:
|
||||
|
||||
https://www.nuand.com/calibration
|
||||
|
||||
And enter your serial number.
|
||||
The website tells you to run something like:
|
||||
|
||||
sudo bladeRF-cli -i
|
||||
flash_init_cal 40 0x9271
|
||||
|
||||
Actual values depend on your device and serial number.
|
||||
|
||||
3. Calibrate the bladeRF device.
|
||||
|
||||
We will work with band 7 on 2.68GHz with a bandwidth of 5 MHz (25 RBs).
|
||||
|
||||
Plug the bladeRF device, then run:
|
||||
|
||||
sudo bladeRF-cli -i
|
||||
set frequency tx 2680000000
|
||||
set frequency rx 2560000000
|
||||
set gain rx 60
|
||||
set gain tx 60
|
||||
set bandwidth 5000000
|
||||
set samplerate 7680000
|
||||
cal lms
|
||||
cal lms
|
||||
cal lms
|
||||
cal dc rxtx
|
||||
cal dc rxtx
|
||||
cal dc rxtx
|
||||
|
||||
4. Tune the RX gain using the enb tracer.
|
||||
|
||||
Run the softmodem and the 'enb' tracer. For instructions, see:
|
||||
|
||||
https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/basic
|
||||
|
||||
In the enb window, check the 'input signal'. You should see some blue
|
||||
signal as seen at:
|
||||
|
||||
https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/T/enb
|
||||
|
||||
(the 'Time signal power' plot).
|
||||
|
||||
The level should be around 30.
|
||||
|
||||
If it's not around 30 then edit your configuration file and modify
|
||||
the value 'max_rxgain' in the section 'RUs'.
|
||||
|
||||
The configuration file to use is:
|
||||
|
||||
configuration/bladeRF/enb-band7-5mhz.conf
|
||||
|
||||
In the configuration file, you also need to set the correct values for:
|
||||
|
||||
- tracking_area_code
|
||||
- plmn_list: mcc, mnc, mnc_length
|
||||
- mme_ip_address: this is the IP address used by the computer running
|
||||
the softmodem to connect to the EPC
|
||||
- NETWORK_INTERFACES: all the ENB*ADDRESS* variables have to point
|
||||
to the IP address of the EPC machine
|
||||
|
||||
5. You're good to go.
|
||||
|
||||
You can now connect a UE and pass some traffic. If everything is well
|
||||
configured you can expect more than 16 Mb/s of throughput in the downlink
|
||||
using iperf and more than 8 Mb/s in the uplink. Looking at the logs, you
|
||||
should find lines containing 'PHR 40' and 'CQI 15'. If your values are
|
||||
lower then your setup may need some adjustments.
|
||||
|
||||
6. In case of problems.
|
||||
|
||||
If the performance of the softmodem is very bad, you can stop it and
|
||||
run the calibration again, without setting the parameters (frequencies,
|
||||
gains, etc.). Just run:
|
||||
|
||||
sudo bladeRF-cli -i
|
||||
cal lms
|
||||
cal dc rxtx
|
||||
|
||||
That may help.
|
||||
|
||||
Be sure to use proper radio equipment (duplexer, antennas, clean
|
||||
environment without interferences).
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/** bladerf_lib.h
|
||||
*
|
||||
* Author: navid nikaein
|
||||
*/
|
||||
|
||||
#include <libbladeRF.h>
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "LOG/log.h"
|
||||
|
||||
/** @addtogroup _BLADERF_PHY_RF_INTERFACE_
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*! \brief BladeRF specific data structure */
|
||||
typedef struct {
|
||||
|
||||
//! opaque BladeRF device struct. An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend)
|
||||
struct bladerf *dev;
|
||||
|
||||
//! Number of buffers
|
||||
unsigned int num_buffers;
|
||||
//! Buffer size
|
||||
unsigned int buffer_size;
|
||||
//! Number of transfers
|
||||
unsigned int num_transfers;
|
||||
//! RX timeout
|
||||
unsigned int rx_timeout_ms;
|
||||
//! TX timeout
|
||||
unsigned int tx_timeout_ms;
|
||||
//! Metadata for RX
|
||||
struct bladerf_metadata meta_rx;
|
||||
//!Metadata for TX
|
||||
struct bladerf_metadata meta_tx;
|
||||
//! Sample rate
|
||||
unsigned int sample_rate;
|
||||
//! time offset between transmiter timestamp and receiver timestamp;
|
||||
double tdiff;
|
||||
//! TX number of forward samples use brf_time_offset to get this value
|
||||
int tx_forward_nsamps; //166 for 20Mhz
|
||||
|
||||
|
||||
// --------------------------------
|
||||
// Debug and output control
|
||||
// --------------------------------
|
||||
//! Number of underflows
|
||||
int num_underflows;
|
||||
//! Number of overflows
|
||||
int num_overflows;
|
||||
//! number of sequential errors
|
||||
int num_seq_errors;
|
||||
//! number of RX errors
|
||||
int num_rx_errors;
|
||||
//! Number of TX errors
|
||||
int num_tx_errors;
|
||||
|
||||
//! timestamp of current TX
|
||||
uint64_t tx_current_ts;
|
||||
//! timestamp of current RX
|
||||
uint64_t rx_current_ts;
|
||||
//! number of actual samples transmitted
|
||||
uint64_t tx_actual_nsamps;
|
||||
//! number of actual samples received
|
||||
uint64_t rx_actual_nsamps;
|
||||
//! number of TX samples
|
||||
uint64_t tx_nsamps;
|
||||
//! number of RX samples
|
||||
uint64_t rx_nsamps;
|
||||
//! number of TX count
|
||||
uint64_t tx_count;
|
||||
//! number of RX count
|
||||
uint64_t rx_count;
|
||||
//! timestamp of RX packet
|
||||
openair0_timestamp rx_timestamp;
|
||||
|
||||
} brf_state_t;
|
||||
/*
|
||||
* func prototypes
|
||||
*/
|
||||
/*! \brief BladeRF Init function (not used at the moment)
|
||||
* \param device RF frontend parameters set by application
|
||||
*/
|
||||
int trx_brf_init(openair0_device *device);
|
||||
|
||||
/*! \brief get current timestamp
|
||||
*\param device the hardware to use
|
||||
*\param module the bladeRf module
|
||||
*/
|
||||
openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module);
|
||||
|
||||
/*! \brief Get BladeRF log level
|
||||
* \param log_level log level
|
||||
* \returns log level of BLADERF device
|
||||
*/
|
||||
int get_brf_log_level(int log_level);
|
||||
|
||||
/*! \brief bladeRF error report
|
||||
* \param status
|
||||
* \returns 0 on success
|
||||
*/
|
||||
int brf_error(int status);
|
||||
|
||||
/*@}*/
|
||||
Reference in New Issue
Block a user