aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2014-08-15 16:06:28 -0700
committerMartin Braun <martin.braun@ettus.com>2014-09-02 12:08:36 +0200
commitda018c53b473428bc5a53134136db24bdc3cf4dc (patch)
tree2d8c7670613930b25fca080e2a7912cbabcc508b /host
parentc219cee65a691792154e0ae2cdf9d81e539b1da8 (diff)
downloaduhd-da018c53b473428bc5a53134136db24bdc3cf4dc.tar.gz
uhd-da018c53b473428bc5a53134136db24bdc3cf4dc.tar.bz2
uhd-da018c53b473428bc5a53134136db24bdc3cf4dc.zip
Give user the option to ignore daughterboard's calibration file at runtime
* Add "ignore-cal-file" to the uhd::device_addr_t arguments * Added documentation for new feature
Diffstat (limited to 'host')
-rw-r--r--host/docs/calibration.dox15
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp9
-rw-r--r--host/lib/usrp/b100/b100_impl.hpp3
-rw-r--r--host/lib/usrp/e100/e100_impl.cpp9
-rw-r--r--host/lib/usrp/e100/e100_impl.hpp3
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp9
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.hpp3
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp9
-rw-r--r--host/lib/usrp/x300/x300_impl.hpp1
9 files changed, 50 insertions, 11 deletions
diff --git a/host/docs/calibration.dox b/host/docs/calibration.dox
index 494cfca49..42a5825ca 100644
--- a/host/docs/calibration.dox
+++ b/host/docs/calibration.dox
@@ -66,5 +66,20 @@ recovered by the user.
- **Linux:** `${HOME}/.uhd/cal/`
- **Windows:** `%APPDATA%\.uhd\cal\`
+\subsection ignore_cal_file Ignoring Calibration Files
+
+At runtime, the user can choose to ignore a daughterboard's calibration file by adding "ignore-cal-file" to the arguments. With the UHD API, it can be done as follows:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ uhd::device_addr_t hint;
+ hint["type"] = "usrp1";
+ hint["ignore-cal-file"] = "";
+ uhd::device_addrs_t dev_addrs = uhd::device::find(hint);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Using tx_waveforms as an example, the user can apply this argument as follows:
+
+ tx_waveforms --args="addr=192.168.10.2,ignore-cal-file" --freq=100e6 --rate=1e6
+
*/
// vim:ft=doxygen:
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 26b0a5aea..24a87a3c8 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -150,6 +150,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
_type = device::USRP;
_tree = property_tree::make();
+ _ignore_cal_file = device_addr.has_key("ignore-cal-file");
//extract the FPGA path for the B100
std::string b100_fpga_image = find_image_path(
@@ -609,9 +610,13 @@ sensor_value_t b100_impl::get_ref_locked(void){
}
void b100_impl::set_rx_fe_corrections(const double lo_freq){
- apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+ if(not _ignore_cal_file){
+ apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+ }
}
void b100_impl::set_tx_fe_corrections(const double lo_freq){
- apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+ if(not _ignore_cal_file){
+ apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+ }
}
diff --git a/host/lib/usrp/b100/b100_impl.hpp b/host/lib/usrp/b100/b100_impl.hpp
index b6752681e..59ea2202e 100644
--- a/host/lib/usrp/b100/b100_impl.hpp
+++ b/host/lib/usrp/b100/b100_impl.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011-2013 Ettus Research LLC
+// Copyright 2011-2014 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -127,6 +127,7 @@ private:
//dboard stuff
uhd::usrp::dboard_manager::sptr _dboard_manager;
uhd::usrp::dboard_iface::sptr _dboard_iface;
+ bool _ignore_cal_file;
std::vector<boost::weak_ptr<uhd::rx_streamer> > _rx_streamers;
std::vector<boost::weak_ptr<uhd::tx_streamer> > _tx_streamers;
diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp
index e59df7708..5becaf5bb 100644
--- a/host/lib/usrp/e100/e100_impl.cpp
+++ b/host/lib/usrp/e100/e100_impl.cpp
@@ -110,6 +110,7 @@ static const uhd::dict<std::string, std::string> model_to_fpga_file_name = boost
e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
_tree = property_tree::make();
_type = device::USRP;
+ _ignore_cal_file = device_addr.has_key("ignore-cal-file");
//read the eeprom so we can determine the hardware
_dev_i2c_iface = e100_ctrl::make_dev_i2c_iface(E100_I2C_DEV_NODE);
@@ -549,9 +550,13 @@ void e100_impl::check_fpga_compat(void){
}
void e100_impl::set_rx_fe_corrections(const double lo_freq){
- apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+ if(not _ignore_cal_file){
+ apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+ }
}
void e100_impl::set_tx_fe_corrections(const double lo_freq){
- apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+ if(not _ignore_cal_file){
+ apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
+ }
}
diff --git a/host/lib/usrp/e100/e100_impl.hpp b/host/lib/usrp/e100/e100_impl.hpp
index d499c4c03..0838bd8c4 100644
--- a/host/lib/usrp/e100/e100_impl.hpp
+++ b/host/lib/usrp/e100/e100_impl.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012 Ettus Research LLC
+// Copyright 2010-2012,2014 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -108,6 +108,7 @@ private:
//dboard stuff
uhd::usrp::dboard_manager::sptr _dboard_manager;
uhd::usrp::dboard_iface::sptr _dboard_iface;
+ bool _ignore_cal_file;
std::vector<boost::weak_ptr<uhd::rx_streamer> > _rx_streamers;
std::vector<boost::weak_ptr<uhd::tx_streamer> > _tx_streamers;
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 93885fbd3..0979ca071 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -369,6 +369,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){
////////////////////////////////////////////////////////////////////
_tree = property_tree::make();
_type = device::USRP;
+ _ignore_cal_file = device_addr.has_key("ignore-cal-file");
_tree->create<std::string>("/name").set("USRP2 / N-Series Device");
for (size_t mbi = 0; mbi < device_args.size(); mbi++){
@@ -796,11 +797,15 @@ sensor_value_t usrp2_impl::get_ref_locked(const std::string &mb){
}
void usrp2_impl::set_rx_fe_corrections(const std::string &mb, const double lo_freq){
- apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/" + mb), "A", lo_freq);
+ if(not _ignore_cal_file){
+ apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/" + mb), "A", lo_freq);
+ }
}
void usrp2_impl::set_tx_fe_corrections(const std::string &mb, const double lo_freq){
- apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/" + mb), "A", lo_freq);
+ if(not _ignore_cal_file){
+ apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/" + mb), "A", lo_freq);
+ }
}
#include <boost/math/special_functions/round.hpp>
diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp
index d7b53e56b..edbb7888b 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.hpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012 Ettus Research LLC
+// Copyright 2010-2012,2014 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -113,6 +113,7 @@ private:
void set_rx_fe_corrections(const std::string &mb, const double);
void set_tx_fe_corrections(const std::string &mb, const double);
+ bool _ignore_cal_file;
//io impl methods and members
UHD_PIMPL_DECL(io_impl) _io_impl;
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index d5eacc3ea..a670f28c4 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -356,6 +356,7 @@ x300_impl::x300_impl(const uhd::device_addr_t &dev_addr)
{
UHD_MSG(status) << "X300 initialization sequence..." << std::endl;
_type = device::USRP;
+ _ignore_cal_file = dev_addr.has_key("ignore-cal-file");
_async_md.reset(new async_md_type(1000/*messages deep*/));
_tree = uhd::property_tree::make();
_tree->create<std::string>("/name").set("X-Series Device");
@@ -1082,12 +1083,16 @@ void x300_impl::setup_radio(const size_t mb_i, const std::string &slot_name)
void x300_impl::set_rx_fe_corrections(const uhd::fs_path &mb_path, const std::string &fe_name, const double lo_freq)
{
- apply_rx_fe_corrections(this->get_tree()->subtree(mb_path), fe_name, lo_freq);
+ if(not _ignore_cal_file){
+ apply_rx_fe_corrections(this->get_tree()->subtree(mb_path), fe_name, lo_freq);
+ }
}
void x300_impl::set_tx_fe_corrections(const uhd::fs_path &mb_path, const std::string &fe_name, const double lo_freq)
{
- apply_tx_fe_corrections(this->get_tree()->subtree(mb_path), fe_name, lo_freq);
+ if(not _ignore_cal_file){
+ apply_tx_fe_corrections(this->get_tree()->subtree(mb_path), fe_name, lo_freq);
+ }
}
boost::uint32_t get_pcie_dma_channel(boost::uint8_t destination, boost::uint8_t prefix)
diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp
index 578e96383..1130c24d6 100644
--- a/host/lib/usrp/x300/x300_impl.hpp
+++ b/host/lib/usrp/x300/x300_impl.hpp
@@ -322,6 +322,7 @@ private:
void set_rx_fe_corrections(const uhd::fs_path &mb_path, const std::string &fe_name, const double lo_freq);
void set_tx_fe_corrections(const uhd::fs_path &mb_path, const std::string &fe_name, const double lo_freq);
+ bool _ignore_cal_file;
/*! Update the IQ MUX settings for the radio peripheral according to given subdev spec.