diff options
author | Ben Hilburn <ben.hilburn@ettus.com> | 2015-01-27 16:07:43 -0800 |
---|---|---|
committer | Ben Hilburn <ben.hilburn@ettus.com> | 2015-01-27 16:07:43 -0800 |
commit | 75d519706b9b0956307a6a4bdc53c36376f19f03 (patch) | |
tree | b2d2144c31c3ea04167ef7e3d1b14f7477c158cf /host/lib/usrp/b200 | |
parent | 8d0d0d01c0a2a5ed1a01da4360226a64ab8117bc (diff) | |
download | uhd-75d519706b9b0956307a6a4bdc53c36376f19f03.tar.gz uhd-75d519706b9b0956307a6a4bdc53c36376f19f03.tar.bz2 uhd-75d519706b9b0956307a6a4bdc53c36376f19f03.zip |
Merging new UHD_IMAGES_DIR utilities and bug fixes.
Also includes NI-USRP Windows Registry Key fixes.
Diffstat (limited to 'host/lib/usrp/b200')
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 24 | ||||
-rw-r--r-- | host/lib/usrp/b200/b200_impl.hpp | 6 |
2 files changed, 14 insertions, 16 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 13bdc09b4..355d12d12 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -17,12 +17,13 @@ #include "b200_impl.hpp" #include "b200_regs.hpp" +#include <uhd/config.hpp> #include <uhd/transport/usb_control.hpp> #include <uhd/utils/msg.hpp> #include <uhd/utils/cast.hpp> #include <uhd/exception.hpp> #include <uhd/utils/static.hpp> -#include <uhd/utils/images.hpp> +#include <uhd/utils/paths.hpp> #include <uhd/utils/safe_call.hpp> #include <uhd/usrp/dboard_eeprom.hpp> #include <boost/format.hpp> @@ -109,13 +110,11 @@ static device_addrs_t b200_find(const device_addr_t &hint) //extract the firmware path for the b200 std::string b200_fw_image; try{ - b200_fw_image = find_image_path(hint.get("fw", B200_FW_FILE_NAME)); + b200_fw_image = hint.get("fw", B200_FW_FILE_NAME); + b200_fw_image = uhd::find_image_path(b200_fw_image, STR(UHD_IMAGES_DIR)); // FIXME } - catch(...){ - UHD_MSG(warning) << boost::format( - "Could not locate B200 firmware.\n" - "Please install the images package. %s\n" - ) % print_images_error(); + catch(uhd::exception &e){ + UHD_MSG(warning) << e.what(); return b200_addrs; } UHD_LOG << "the firmware image: " << b200_fw_image << std::endl; @@ -783,11 +782,11 @@ void b200_impl::check_fw_compat(void) if (compat_major != B200_FW_COMPAT_NUM_MAJOR){ throw uhd::runtime_error(str(boost::format( - "Expected firmware compatibility number 0x%x, but got 0x%x.%x:\n" + "Expected firmware compatibility number %d.%d, but got %d.%d:\n" "The firmware build is not compatible with the host code build.\n" "%s" - ) % int(B200_FW_COMPAT_NUM_MAJOR) % compat_major % compat_minor - % print_images_error())); + ) % int(B200_FW_COMPAT_NUM_MAJOR) % int(B200_FW_COMPAT_NUM_MINOR) + % compat_major % compat_minor % print_utility_error("uhd_images_downloader.py"))); } _tree->create<std::string>("/mboards/0/fw_version").set(str(boost::format("%u.%u") % compat_major % compat_minor)); @@ -804,11 +803,10 @@ void b200_impl::check_fpga_compat(void) if (compat_major != B200_FPGA_COMPAT_NUM){ throw uhd::runtime_error(str(boost::format( - "Expected FPGA compatibility number 0x%x, but got 0x%x.%x:\n" + "Expected FPGA compatibility number %d, but got %d:\n" "The FPGA build is not compatible with the host code build.\n" "%s" - ) % int(B200_FPGA_COMPAT_NUM) % compat_major % compat_minor - % print_images_error())); + ) % int(B200_FPGA_COMPAT_NUM) % compat_major % print_utility_error("uhd_images_downloader.py"))); } _tree->create<std::string>("/mboards/0/fpga_version").set(str(boost::format("%u.%u") % compat_major % compat_minor)); diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index ab95ebce1..396819f9a 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -45,9 +45,9 @@ #include <uhd/transport/bounded_buffer.hpp> #include <boost/weak_ptr.hpp> #include "recv_packet_demuxer_3000.hpp" -static const boost::uint8_t B200_FW_COMPAT_NUM_MAJOR = 0x07; -static const boost::uint8_t B200_FW_COMPAT_NUM_MINOR = 0x00; -static const boost::uint16_t B200_FPGA_COMPAT_NUM = 0x04; +static const boost::uint8_t B200_FW_COMPAT_NUM_MAJOR = 7; +static const boost::uint8_t B200_FW_COMPAT_NUM_MINOR = 0; +static const boost::uint16_t B200_FPGA_COMPAT_NUM = 4; static const double B200_BUS_CLOCK_RATE = 100e6; static const double B200_DEFAULT_TICK_RATE = 32e6; static const double B200_DEFAULT_FREQ = 100e6; // Hz |