From a8a638d5f848f20b1cce1fa3456a0671e9a0675f Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Tue, 31 Jan 2017 17:32:53 -0800 Subject: x300: only remove existing items from zpu_iface_registry in destructor --- host/lib/usrp/x300/x300_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'host/lib') diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 028058a58..374247fea 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1022,7 +1022,9 @@ x300_impl::~x300_impl(void) release(mb.zpu_ctrl); //If the process is killed, the entire registry will disappear so we //don't need to worry about unclean shutdowns here. - get_pcie_zpu_iface_registry().pop(mb.get_pri_eth().addr); + if (get_pcie_zpu_iface_registry().has_key(mb.get_pri_eth().addr)) { + get_pcie_zpu_iface_registry().pop(mb.get_pri_eth().addr); + } } } } -- cgit v1.2.3 From 63fcfb9574d64797b807a0dd356f5d7bfc48f082 Mon Sep 17 00:00:00 2001 From: michael-west Date: Wed, 1 Feb 2017 12:59:09 -0800 Subject: GPSDO: Improved detection - Added re-sending of *IDN? command if no reply or unexpected string (i.e. during GPSDO firmware initialization) - Shortened detection timeout to return sooner if no GPSDO present (faster initialization) --- host/lib/usrp/gps_ctrl.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp index f4a42af34..447a13c33 100644 --- a/host/lib/usrp/gps_ctrl.cpp +++ b/host/lib/usrp/gps_ctrl.cpp @@ -203,13 +203,15 @@ public: //first we look for an internal GPSDO _flush(); //get whatever junk is in the rx buffer right now, and throw it away + _send("*IDN?\r\n"); //request identity from the GPSDO //then we loop until we either timeout, or until we get a response that indicates we're a JL device - const boost::system_time comm_timeout = boost::get_system_time() + milliseconds(GPS_COMM_TIMEOUT_MS); + //maximum response time was measured at ~320ms, so we set the timeout at 650ms + const boost::system_time comm_timeout = boost::get_system_time() + milliseconds(650); while(boost::get_system_time() < comm_timeout) { reply = _recv(); - //known devices are JL "FireFly" and "LC_XO" + //known devices are JL "FireFly", "GPSTCXO", and "LC_XO" if(reply.find("FireFly") != std::string::npos or reply.find("LC_XO") != std::string::npos or reply.find("GPSTCXO") != std::string::npos) { @@ -218,14 +220,22 @@ public: } else if(reply.substr(0, 3) == "$GP") { i_heard_some_nmea = true; //but keep looking } else if(not reply.empty()) { - i_heard_something_weird = true; //probably wrong baud rate + // wrong baud rate or firmware still initializing + i_heard_something_weird = true; + _send("*IDN?\r\n"); //re-send identity request + } else { + // _recv timed out + _send("*IDN?\r\n"); //re-send identity request } } - if((i_heard_some_nmea) && (_gps_type != GPS_TYPE_INTERNAL_GPSDO)) _gps_type = GPS_TYPE_GENERIC_NMEA; - - if((_gps_type == GPS_TYPE_NONE) && i_heard_something_weird) { - UHD_MSG(error) << "GPS invalid reply \"" << reply << "\", assuming none available" << std::endl; + if (_gps_type == GPS_TYPE_NONE) + { + if(i_heard_some_nmea) { + _gps_type = GPS_TYPE_GENERIC_NMEA; + } else if(i_heard_something_weird) { + UHD_MSG(error) << "GPS invalid reply \"" << reply << "\", assuming none available" << std::endl; + } } switch(_gps_type) { -- cgit v1.2.3 From 9b6b3315afb2afd3d7c2deb74d8275d8515eafb1 Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Thu, 12 Jan 2017 15:44:24 -0800 Subject: legacy_compat: fallback to min(spp) if no user-specified spp value exists --- host/lib/rfnoc/legacy_compat.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'host/lib') diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index a396fd677..7acaa898c 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -467,17 +467,25 @@ private: // methods // If it's not provided, we provide our own spp value. const size_t args_spp = args.args.cast("spp", 0); if (dir == uhd::RX_DIRECTION) { + size_t target_spp = _rx_spp; if (args.args.has_key("spp") and args_spp != _rx_spp) { + target_spp = args_spp; + // TODO: Update flow control on the blocks + } else { for (size_t mboard = 0; mboard < _num_mboards; mboard++) { for (size_t radio = 0; radio < _num_radios_per_board; radio++) { - get_block_ctrl(mboard, RADIO_BLOCK_NAME, radio)->set_arg("spp", args_spp); + const size_t this_spp = get_block_ctrl(mboard, RADIO_BLOCK_NAME, radio)->get_arg("spp"); + target_spp = std::min(this_spp, target_spp); } } - _rx_spp = args_spp; - // TODO: Update flow control on the blocks - } else { - args.args["spp"] = str(boost::format("%d") % _rx_spp); } + for (size_t mboard = 0; mboard < _num_mboards; mboard++) { + for (size_t radio = 0; radio < _num_radios_per_board; radio++) { + get_block_ctrl(mboard, RADIO_BLOCK_NAME, radio)->set_arg("spp", target_spp); + } + } + _rx_spp = target_spp; + args.args["spp"] = str(boost::format("%d") % _rx_spp); } else { if (args.args.has_key("spp") and args_spp != _tx_spp) { _tx_spp = args_spp; @@ -574,10 +582,10 @@ private: // methods const size_t this_spp = get_block_ctrl(i, RADIO_BLOCK_NAME, k)->get_arg("spp"); if (this_spp != _rx_spp) { - throw uhd::runtime_error(str( - boost::format("[legacy compat] Radios have differing spp values: %s has %d, others have %d") + UHD_LOG << str( + boost::format("[legacy compat] Radios have differing spp values: %s has %d, others have %d. UHD will use smaller spp value for all connections. Performance might be not optimal.") % radio_block_id.to_string() % this_spp % _rx_spp - )); + ); } } } -- cgit v1.2.3