diff options
-rw-r--r-- | host/CMakeLists.txt | 4 | ||||
-rw-r--r-- | host/docs/usrp_b200.dox | 4 | ||||
-rw-r--r-- | host/examples/test_messages.cpp | 18 | ||||
-rw-r--r-- | host/lib/rfnoc/legacy_compat.cpp | 24 | ||||
-rw-r--r-- | host/lib/usrp/gps_ctrl.cpp | 24 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 4 | ||||
-rwxr-xr-x | host/tests/devtest/uhd_test_base.py | 1 |
7 files changed, 54 insertions, 25 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index a7274a451..368db6309 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -357,8 +357,8 @@ UHD_INSTALL(FILES #{{{IMG_SECTION # This section is written automatically by /images/create_imgs_package.py # Any manual changes in here will be overwritten. -SET(UHD_IMAGES_MD5SUM "e5ac0830665a6c77a46ba0ae32f9fa11") -SET(UHD_IMAGES_DOWNLOAD_SRC "uhd-images_003.010.001.001-release.zip") +SET(UHD_IMAGES_MD5SUM "53a1ea139d8344fec9914f05db79bdd0") +SET(UHD_IMAGES_DOWNLOAD_SRC "uhd-images_003.010.001.001-7-g63fcfb95.zip") #}}} ######################################################################## diff --git a/host/docs/usrp_b200.dox b/host/docs/usrp_b200.dox index 1d5374b3a..a17ccc4dc 100644 --- a/host/docs/usrp_b200.dox +++ b/host/docs/usrp_b200.dox @@ -268,7 +268,7 @@ Component ID | Description | Details <sup>1</sup> Only on the B210 -<sup>2</sup> Only since rev. 6 (green board) +<sup>2</sup> Only since rev. 6 (green board). GPIO pinout is 1=GPIO_0, 2=GPIO_1, 3=GPIO_2, 4=GPIO_3, 5=GPIO_4, 6=GPIO_5, 7=GPIO_6, 8=GPIO_7, 9=GND, 10=GND Below is a table showing the B200mini on-board connectors and switches: @@ -278,7 +278,7 @@ Component ID | Description | Details J6<sup>1</sup> | GPIO Header | Header connected to the FPGA for GPIO purposes. SW1 | FX3 Hard Reset Switch | Resets the USB controller / System reset - <sup>1</sup> GPIO pinout is 1=3.3V, 2=GPIO_0, 3=GPIO_1, 4=GPIO_2, 5=GPIO_3, 6=GND, 7=3.3V, 8=GPIO_4, 9=GPIO_5, 10=,GPIO_6 11=GPIO_7, 12=GND + <sup>1</sup> GPIO pinout is 1=3.3V, 2=GPIO_0, 3=GPIO_1, 4=GPIO_2, 5=GPIO_3, 6=GND, 7=3.3V, 8=GPIO_4, 9=GPIO_5, 10=GPIO_6, 11=GPIO_7, 12=GND */ diff --git a/host/examples/test_messages.cpp b/host/examples/test_messages.cpp index 4c07d34b1..4135bca56 100644 --- a/host/examples/test_messages.cpp +++ b/host/examples/test_messages.cpp @@ -264,7 +264,12 @@ void flush_async(uhd::tx_streamer::sptr tx_stream){ } void flush_recv(uhd::rx_streamer::sptr rx_stream){ - std::vector<std::complex<float> > buff(rx_stream->get_max_num_samps()); + uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE); + stream_cmd.num_samps = rx_stream->get_max_num_samps()*3; + stream_cmd.stream_now = true; + rx_stream->issue_stream_cmd(stream_cmd); + + std::vector<std::complex<float> > buff(stream_cmd.num_samps); uhd::rx_metadata_t md; do{ @@ -285,6 +290,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("help", "help message") ("args", po::value<std::string>(&args)->default_value(""), "multi uhd device address args") ("ntests", po::value<size_t>(&ntests)->default_value(50), "number of tests to run") + ("test-chain", "Run broken chain tests") ; po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); @@ -310,15 +316,18 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //------------------------------------------------------------------ // begin messages test //------------------------------------------------------------------ - static const uhd::dict<std::string, boost::function<bool(uhd::usrp::multi_usrp::sptr, uhd::rx_streamer::sptr, uhd::tx_streamer::sptr)> > + static uhd::dict<std::string, boost::function<bool(uhd::usrp::multi_usrp::sptr, uhd::rx_streamer::sptr, uhd::tx_streamer::sptr)> > tests = boost::assign::map_list_of ("Test Burst ACK ", &test_burst_ack_message) ("Test Underflow ", &test_underflow_message) ("Test Time Error", &test_time_error_message) ("Test Late Command", &test_late_command_message) - ("Test Broken Chain", &test_broken_chain_message) ; + if (vm.count("test-chain")) { + tests["Test Broken Chain"] = &test_broken_chain_message; + } + //init result counts uhd::dict<std::string, size_t> failures, successes; BOOST_FOREACH(const std::string &key, tests.keys()){ @@ -331,8 +340,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ for (size_t n = 0; n < ntests; n++){ std::string key = tests.keys()[std::rand() % tests.size()]; bool pass = tests[key](usrp, rx_stream, tx_stream); - flush_async(tx_stream); + flush_recv(rx_stream); + flush_async(tx_stream); //store result if (pass) successes[key]++; diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index a8b6d4f68..4060c62ae 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -458,17 +458,25 @@ private: // methods // If it's not provided, we provide our own spp value. const size_t args_spp = args.args.cast<size_t>("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<radio_ctrl>(mboard, RADIO_BLOCK_NAME, radio)->set_arg<int>("spp", args_spp); + const size_t this_spp = get_block_ctrl<radio_ctrl>(mboard, RADIO_BLOCK_NAME, radio)->get_arg<int>("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<radio_ctrl>(mboard, RADIO_BLOCK_NAME, radio)->set_arg<int>("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; @@ -565,10 +573,10 @@ private: // methods const size_t this_spp = get_block_ctrl<radio_ctrl>(i, RADIO_BLOCK_NAME, k)->get_arg<int>("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 - )); + ); } } } 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) { diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index aa54c2228..edf254130 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1072,7 +1072,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); + } } } } diff --git a/host/tests/devtest/uhd_test_base.py b/host/tests/devtest/uhd_test_base.py index 62a11c0ef..3bf2792c4 100755 --- a/host/tests/devtest/uhd_test_base.py +++ b/host/tests/devtest/uhd_test_base.py @@ -57,7 +57,6 @@ class uhd_test_case(unittest.TestCase): if self.results_file and os.path.isfile(self.results_file): self.results = yaml.safe_load(open(self.results_file).read()) or {} self.args_str = os.getenv('_UHD_TEST_ARGS_STR', "") - time.sleep(15) # Wait for x300 devices to reclaim them self.usrp_info = get_usrp_list(self.args_str)[0] if not self.results.has_key(self.usrp_info['serial']): self.results[self.usrp_info['serial']] = {} |