From af0543a8b72e924c26503d838976e249d8ca6fbb Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 30 Aug 2010 18:42:45 -0700 Subject: usrp1: work on gpio clock divider for dbsrx, still not locking --- host/lib/usrp/usrp1/dboard_iface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index b2221e221..454de3ece 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -49,8 +49,8 @@ public: _codec = codec; //init the clock rate shadows - this->set_clock_rate(UNIT_RX, _clock->get_master_clock_freq()); - this->set_clock_rate(UNIT_TX, _clock->get_master_clock_freq()); + this->set_clock_rate(UNIT_RX, this->get_clock_rates(UNIT_RX).front()); + this->set_clock_rate(UNIT_TX, this->get_clock_rates(UNIT_TX).front()); } ~usrp1_dboard_iface() @@ -134,14 +134,14 @@ void usrp1_dboard_iface::set_clock_rate(unit_t unit, double rate) _clock_rates[unit] = rate; if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){ - size_t divider = size_t(rate/_clock->get_master_clock_freq()); + size_t divider = size_t(_clock->get_master_clock_freq()/rate); switch(_dboard_slot){ case usrp1_impl::DBOARD_SLOT_A: - _iface->poke32(FR_RX_A_REFCLK, (divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_A_REFCLK, (2*divider & 0x7f) | 0x80); break; case usrp1_impl::DBOARD_SLOT_B: - _iface->poke32(FR_RX_B_REFCLK, (divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_B_REFCLK, (2*divider & 0x7f) | 0x80); break; } } @@ -151,7 +151,7 @@ std::vector usrp1_dboard_iface::get_clock_rates(unit_t unit) { std::vector rates; if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){ - for (size_t div = 1; div <= 127; div++) + for (size_t div = 8; div <= 127; div++) rates.push_back(_clock->get_master_clock_freq() / div); } else{ -- cgit v1.2.3 From 954be82738b9237e77162566d39e2daed8105a2a Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 30 Aug 2010 19:02:56 -0700 Subject: usrp1: init the subdev specs so they will be non-empty --- host/lib/usrp/usrp1/usrp1_impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index 3c3306525..ccb41a09d 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -21,6 +21,7 @@ #include "usrp_spi_defs.h" #include #include +#include #include #include #include @@ -171,6 +172,10 @@ usrp1_impl::usrp1_impl(uhd::transport::usb_zero_copy::sptr data_transport, //turn on the transmitter _ctrl_transport->usrp_tx_enable(true); + + //init the subdev specs + this->mboard_set(MBOARD_PROP_RX_SUBDEV_SPEC, subdev_spec_t()); + this->mboard_set(MBOARD_PROP_TX_SUBDEV_SPEC, subdev_spec_t()); } usrp1_impl::~usrp1_impl(void){ -- cgit v1.2.3 From c9cd9b605897078daed77c8b7f9c538cb77bd4bc Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 31 Aug 2010 12:19:17 -0700 Subject: usrp1: flush for flow error messages --- host/lib/usrp/usrp1/io_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index 920c47b30..92e8bc20a 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -189,7 +189,7 @@ bool usrp1_impl::io_impl::check_underrun(usrp_ctrl::sptr ctrl_if, if (ret < 0) std::cerr << "USRP: underrun check failed" << std::endl; if (underrun) - std::cerr << "Uu"; + std::cerr << "U" << std::flush; send_state.underrun_poll_samp_count = 0; } @@ -289,7 +289,7 @@ bool usrp1_impl::io_impl::check_overrun(usrp_ctrl::sptr ctrl_if, if (ret < 0) std::cerr << "USRP: overrrun check failed" << std::endl; if (overrun) - std::cerr << "Oo"; + std::cerr << "O" << std::flush; recv_state.overrun_poll_samp_count = 0; } -- cgit v1.2.3 From 80fe3189afd52d1aab95ee95e71d5d50bddbba55 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 31 Aug 2010 13:08:50 -0700 Subject: usrp1: Fedora sdcc note and change fw error to warning (find should not error) --- host/lib/usrp/usrp1/usrp1_impl.cpp | 17 ++++++++++++++--- images/README | 5 +++++ 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index ccb41a09d..9f824045d 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -50,9 +51,19 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) if (hint.has_key("type") and hint["type"] != "usrp1") return usrp1_addrs; //extract the firmware path for the USRP1 - std::string usrp1_fw_image = find_image_path( - hint.has_key("fw")? hint["fw"] : "usrp1_fw.ihx" - ); + std::string usrp1_fw_image; + try{ + usrp1_fw_image = find_image_path( + hint.has_key("fw")? hint["fw"] : "usrp1_fw.ihx" + ); + } + catch(const std::exception &e){ + uhd::print_warning( + "Could not locate USRP1 firmware.\n" + "Please install the images package.\n" + ); + return usrp1_addrs; + } std::cout << "USRP1 firmware image: " << usrp1_fw_image << std::endl; //see what we got on the USB bus diff --git a/images/README b/images/README index ec8391826..2f9c6a95e 100644 --- a/images/README +++ b/images/README @@ -18,3 +18,8 @@ To build the package (unix): The package generator types are described here: http://www.cmake.org/Wiki/CMake:CPackPackageGenerators + +Fedora note: + The sdcc binaries are prefixed with "sdcc-" which breaks the build. + However, /usr/libexec/sdcc contains properly named sdcc binaries. + export PATH=${PATH}:/usr/libexec/sdcc -- cgit v1.2.3 From 9a3217cbbeb39d677a439fe0982a7ac4d7f251c2 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 31 Aug 2010 13:21:32 -0700 Subject: usrp1: tested dbsrx, works with lower divider --- host/lib/usrp/usrp1/dboard_iface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index 454de3ece..4791b55ce 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -137,11 +137,11 @@ void usrp1_dboard_iface::set_clock_rate(unit_t unit, double rate) size_t divider = size_t(_clock->get_master_clock_freq()/rate); switch(_dboard_slot){ case usrp1_impl::DBOARD_SLOT_A: - _iface->poke32(FR_RX_A_REFCLK, (2*divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_A_REFCLK, (divider & 0x7f) | 0x80); break; case usrp1_impl::DBOARD_SLOT_B: - _iface->poke32(FR_RX_B_REFCLK, (2*divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_B_REFCLK, (divider & 0x7f) | 0x80); break; } } @@ -151,7 +151,7 @@ std::vector usrp1_dboard_iface::get_clock_rates(unit_t unit) { std::vector rates; if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){ - for (size_t div = 8; div <= 127; div++) + for (size_t div = 1; div <= 127; div++) rates.push_back(_clock->get_master_clock_freq() / div); } else{ -- cgit v1.2.3