aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorBalint Seeber <balint@ettus.com>2014-03-19 15:53:27 -0700
committerBalint Seeber <balint@ettus.com>2014-03-19 15:53:27 -0700
commitea66e24a96abcfcb49b907eeebf2f4944118f50e (patch)
tree2eba5c80c9ebfd1abed40cab511edcfb302264f8 /host/lib
parente898450a2e9bff57ebc25b48ed10508ac6383b30 (diff)
downloaduhd-ea66e24a96abcfcb49b907eeebf2f4944118f50e.tar.gz
uhd-ea66e24a96abcfcb49b907eeebf2f4944118f50e.tar.bz2
uhd-ea66e24a96abcfcb49b907eeebf2f4944118f50e.zip
b200: changed ad9361 read timeout handling (kicks in when requesting master_clock_rate above 56MHz)
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/b200/b200_iface.cpp13
-rw-r--r--host/lib/usrp/common/ad9361_ctrl.cpp2
2 files changed, 11 insertions, 4 deletions
diff --git a/host/lib/usrp/b200/b200_iface.cpp b/host/lib/usrp/b200/b200_iface.cpp
index 630ce9ac6..63f01cea7 100644
--- a/host/lib/usrp/b200/b200_iface.cpp
+++ b/host/lib/usrp/b200/b200_iface.cpp
@@ -301,7 +301,7 @@ public:
void ad9361_transact(const unsigned char in_buff[64], unsigned char out_buff[64]) {
const int bytes_to_write = 64;
const int bytes_to_read = 64;
- const size_t read_retries = 10;
+ const size_t read_retries = 3;
int ret = fx3_control_write(B200_VREQ_AD9361_CTRL_WRITE, 0x00, 0x00, (unsigned char *)in_buff, bytes_to_write);
if (ret < 0)
@@ -311,9 +311,16 @@ public:
for (size_t i = 0; i < read_retries; i++)
{
- ret = fx3_control_read(B200_VREQ_AD9361_CTRL_READ, 0x00, 0x00, out_buff, bytes_to_read, 3000);
+ ret = fx3_control_read(B200_VREQ_AD9361_CTRL_READ, 0x00, 0x00, out_buff, bytes_to_read, 5000);
if (ret < 0)
- throw uhd::io_error((boost::format("Failed to read AD9361 (%d: %s)") % ret % libusb_error_name(ret)).str());
+ {
+ UHD_MSG(warning) << (boost::format("Failed to read AD9361 (%d: %s). Retrying (%d of %d)...")
+ % ret
+ % libusb_error_name(ret)
+ % (i+1)
+ % read_retries)
+ << std::endl;
+ }
if (ret == bytes_to_read)
return;
diff --git a/host/lib/usrp/common/ad9361_ctrl.cpp b/host/lib/usrp/common/ad9361_ctrl.cpp
index 1afa2fbb7..10496f2a9 100644
--- a/host/lib/usrp/common/ad9361_ctrl.cpp
+++ b/host/lib/usrp/common/ad9361_ctrl.cpp
@@ -151,7 +151,7 @@ struct ad9361_ctrl_impl : public ad9361_ctrl
//handle errors
const size_t len = my_strnlen(out->error_msg, AD9361_TRANSACTION_MAX_ERROR_MSG);
const std::string error_msg(out->error_msg, len);
- if (not error_msg.empty()) throw uhd::runtime_error("ad9361 do transaction: " + error_msg);
+ if (not error_msg.empty()) throw uhd::runtime_error("[ad9361_ctrl::do_transaction] firmware reported: \"" + error_msg + "\"");
//return result done!
return *out;