From 75d519706b9b0956307a6a4bdc53c36376f19f03 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Tue, 27 Jan 2015 16:07:43 -0800 Subject: Merging new UHD_IMAGES_DIR utilities and bug fixes. Also includes NI-USRP Windows Registry Key fixes. --- host/lib/usrp/b200/b200_impl.cpp | 24 +++++++++++------------- host/lib/usrp/b200/b200_impl.hpp | 6 +++--- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'host/lib/usrp/b200') 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 #include #include #include #include #include -#include +#include #include #include #include @@ -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("/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("/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 #include #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 -- cgit v1.2.3