aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorBen Hilburn <ben.hilburn@ettus.com>2014-11-03 17:05:26 -0800
committerMartin Braun <martin.braun@ettus.com>2014-11-21 00:16:47 +0100
commitbeabf3d302a98a0a1e28ae8cc4d338f0bd13db6e (patch)
treee2b7ab145ec2daa83c4589e96b0f67bc5a3fd38d /host/lib/usrp
parent3407376f8af0fc39f29c1c8ce9020d02a2bf05d9 (diff)
downloaduhd-beabf3d302a98a0a1e28ae8cc4d338f0bd13db6e.tar.gz
uhd-beabf3d302a98a0a1e28ae8cc4d338f0bd13db6e.tar.bz2
uhd-beabf3d302a98a0a1e28ae8cc4d338f0bd13db6e.zip
uhd: replaced the `images_error` with a generic utility error
- Deleted images.*, moved functionality to paths.* - Applies for all devices that check FPGA or FW compat numbers - Adds generic utility search tool
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp10
-rw-r--r--host/lib/usrp/b100/b100_impl.hpp2
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp15
-rw-r--r--host/lib/usrp/b200/b200_impl.hpp6
-rw-r--r--host/lib/usrp/e100/e100_impl.cpp4
-rw-r--r--host/lib/usrp/e300/e300_impl.cpp4
-rw-r--r--host/lib/usrp/e300/e300_network.cpp2
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp4
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp8
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp14
10 files changed, 34 insertions, 35 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 24a87a3c8..c4279913c 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -23,7 +23,7 @@
#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 <boost/format.hpp>
#include <boost/assign/list_of.hpp>
@@ -82,7 +82,7 @@ static device_addrs_t b100_find(const device_addr_t &hint)
b100_fw_image = find_image_path(hint.get("fw", B100_FW_FILE_NAME));
}
catch(...){
- UHD_MSG(warning) << boost::format("Could not locate B100 firmware. %s\n") % print_images_error();
+ UHD_MSG(warning) << boost::format("Could not locate B100 firmware. %s\n") % print_utility_error("uhd_images_downloader.py");
return b100_addrs;
}
UHD_LOG << "the firmware image: " << b100_fw_image << std::endl;
@@ -532,10 +532,10 @@ void b100_impl::check_fw_compat(void){
);
if (fw_compat_num != B100_FW_COMPAT_NUM){
throw uhd::runtime_error(str(boost::format(
- "Expected firmware compatibility number 0x%x, but got 0x%x:\n"
+ "Expected firmware compatibility number %d, but got %d:\n"
"The firmware build is not compatible with the host code build.\n"
"%s"
- ) % B100_FW_COMPAT_NUM % fw_compat_num % print_images_error()));
+ ) % int(B100_FW_COMPAT_NUM) % fw_compat_num % print_utility_error("uhd_images_downloader.py")));
}
_tree->create<std::string>("/mboards/0/fw_version").set(str(boost::format("%u.0") % fw_compat_num));
}
@@ -552,7 +552,7 @@ void b100_impl::check_fpga_compat(void){
"Expected FPGA compatibility number %d, but got %d:\n"
"The FPGA build is not compatible with the host code build."
"%s"
- ) % int(B100_FPGA_COMPAT_NUM) % fpga_major % print_images_error()));
+ ) % int(B100_FPGA_COMPAT_NUM) % fpga_major % print_utility_error("uhd_images_downloader.py")));
}
_tree->create<std::string>("/mboards/0/fpga_version").set(str(boost::format("%u.%u") % fpga_major % fpga_minor));
}
diff --git a/host/lib/usrp/b100/b100_impl.hpp b/host/lib/usrp/b100/b100_impl.hpp
index 59ea2202e..dbca543be 100644
--- a/host/lib/usrp/b100/b100_impl.hpp
+++ b/host/lib/usrp/b100/b100_impl.hpp
@@ -46,7 +46,7 @@
static const double B100_LINK_RATE_BPS = 256e6/5; //pratical link rate (< 480 Mbps)
static const std::string B100_FW_FILE_NAME = "usrp_b100_fw.ihx";
static const std::string B100_FPGA_FILE_NAME = "usrp_b100_fpga.bin";
-static const boost::uint16_t B100_FW_COMPAT_NUM = 0x04;
+static const boost::uint16_t B100_FW_COMPAT_NUM = 4;
static const boost::uint16_t B100_FPGA_COMPAT_NUM = 11;
static const boost::uint32_t B100_RX_SID_BASE = 30;
static const boost::uint32_t B100_TX_ASYNC_SID = 10;
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index 6d1172c98..b3c190c50 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -22,7 +22,7 @@
#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>
@@ -115,7 +115,7 @@ static device_addrs_t b200_find(const device_addr_t &hint)
UHD_MSG(warning) << boost::format(
"Could not locate B200 firmware.\n"
"Please install the images package. %s\n"
- ) % print_images_error();
+ ) % print_utility_error("uhd_images_downloader.py");
return b200_addrs;
}
UHD_LOG << "the firmware image: " << b200_fw_image << std::endl;
@@ -791,11 +791,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));
@@ -812,11 +812,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 22e962bd5..71592f60b 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
diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp
index 8b4f2316c..ac419e0e0 100644
--- a/host/lib/usrp/e100/e100_impl.cpp
+++ b/host/lib/usrp/e100/e100_impl.cpp
@@ -21,7 +21,7 @@
#include <uhd/utils/msg.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/static.hpp>
-#include <uhd/utils/images.hpp>
+#include <uhd/utils/paths.hpp>
#include <boost/bind.hpp>
#include <boost/format.hpp>
#include <boost/filesystem.hpp>
@@ -132,7 +132,7 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
e100_fpga_image = find_image_path(device_addr.get("fpga", default_fpga_file_name));
}
catch(...){
- UHD_MSG(error) << boost::format("Could not find FPGA image. %s\n") % print_images_error();
+ UHD_MSG(error) << boost::format("Could not find FPGA image. %s\n") % print_utility_error("uhd_images_downloader.py");
throw;
}
e100_load_fpga(e100_fpga_image);
diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp
index e42ac390e..8807a56e4 100644
--- a/host/lib/usrp/e300/e300_impl.cpp
+++ b/host/lib/usrp/e300/e300_impl.cpp
@@ -28,7 +28,7 @@
#include <uhd/utils/msg.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/static.hpp>
-#include <uhd/utils/images.hpp>
+#include <uhd/utils/paths.hpp>
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/transport/if_addrs.hpp>
#include <uhd/transport/udp_zero_copy.hpp>
@@ -397,7 +397,7 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr)
"%s"
) % fpga::COMPAT_MAJOR
% _get_version(FPGA_MAJOR) % _get_version(FPGA_MINOR)
- % print_images_error()));
+ % print_utility_error("uhd_images_downloader.py")));
}
////////////////////////////////////////////////////////////////////
diff --git a/host/lib/usrp/e300/e300_network.cpp b/host/lib/usrp/e300/e300_network.cpp
index 883ff0c4f..59e1eec86 100644
--- a/host/lib/usrp/e300/e300_network.cpp
+++ b/host/lib/usrp/e300/e300_network.cpp
@@ -33,7 +33,7 @@
#include <uhd/utils/msg.hpp>
#include <uhd/utils/byteswap.hpp>
-#include <uhd/utils/images.hpp>
+#include <uhd/utils/paths.hpp>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index 709092e42..dbd5408e8 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -23,7 +23,7 @@
#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 <boost/format.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/filesystem.hpp>
@@ -85,7 +85,7 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
usrp1_fw_image = find_image_path(hint.get("fw", "usrp1_fw.ihx"));
}
catch(...){
- UHD_MSG(warning) << boost::format("Could not locate USRP1 firmware. %s") % print_images_error();
+ UHD_MSG(warning) << boost::format("Could not locate USRP1 firmware. %s") % print_utility_error("uhd_images_downloader.py");
}
UHD_LOG << "USRP1 firmware image: " << usrp1_fw_image << std::endl;
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index b2085807f..65cf90a17 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -23,7 +23,7 @@
#include <uhd/utils/msg.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/tasks.hpp>
-#include <uhd/utils/images.hpp>
+#include <uhd/utils/paths.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/types/dict.hpp>
#include <boost/thread.hpp>
@@ -375,7 +375,7 @@ public:
fpga_image_path = uhd::find_image_path(fpga_image);
}
catch(const std::exception &){
- return str(boost::format("Could not find %s and %s in your images path!\n%s") % fw_image % fpga_image % print_images_error());
+ return str(boost::format("Could not find %s and %s in your images path!\n%s") % fw_image % fpga_image % print_utility_error("uhd_images_downloader.py"));
}
//escape char for multi-line cmd + newline + indent?
@@ -389,13 +389,13 @@ public:
if (this->get_rev() == USRP2_REV3 or this->get_rev() == USRP2_REV4){
const std::string card_burner = (fs::path(uhd::get_pkg_path()) / UHD_LIB_DIR / "uhd" / "utils" / "usrp2_card_burner.py").string();
const std::string card_burner_cmd = str(boost::format("\"%s%s\" %s--fpga=\"%s\" %s--fw=\"%s\"") % sudo % card_burner % ml % fpga_image_path % ml % fw_image_path);
- return str(boost::format("%s\n%s") % print_images_error() % card_burner_cmd);
+ return str(boost::format("%s\n%s") % print_utility_error("uhd_images_downloader.py") % card_burner_cmd);
}
else{
const std::string addr = _ctrl_transport->get_recv_addr();
const std::string net_burner_path = (fs::path(uhd::get_pkg_path()) / UHD_LIB_DIR / "uhd" / "utils" / "usrp_n2xx_simple_net_burner").string();
const std::string net_burner_cmd = str(boost::format("\"%s\" %s--addr=\"%s\"") % net_burner_path % ml % addr);
- return str(boost::format("%s\n%s") % print_images_error() % net_burner_cmd);
+ return str(boost::format("%s\n%s") % print_utility_error("uhd_images_downloader.py") % net_burner_cmd);
}
}
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index a879ae02d..8d255097d 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -24,7 +24,7 @@
#include "apply_corrections.hpp"
#include <uhd/utils/static.hpp>
#include <uhd/utils/msg.hpp>
-#include <uhd/utils/images.hpp>
+#include <uhd/utils/paths.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/usrp/subdev_spec.hpp>
#include <uhd/transport/if_addrs.hpp>
@@ -171,7 +171,7 @@ static device_addrs_t x300_find_pcie(const device_addr_t &hint, bool explicit_qu
default:
continue;
}
-
+
niriok_proxy::sptr kernel_proxy = niriok_proxy::make_and_open(dev_info.interface_path);
//Attempt to read the name from the EEPROM and perform filtering.
@@ -1670,11 +1670,11 @@ void x300_impl::check_fw_compat(const fs_path &mb_path, wb_iface::sptr iface)
if (compat_major != X300_FW_COMPAT_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(X300_FW_COMPAT_MAJOR) % compat_major % compat_minor
- % print_images_error()));
+ ) % int(X300_FW_COMPAT_MAJOR) % int(X300_FW_COMPAT_MINOR)
+ % compat_major % compat_minor % print_utility_error("uhd_images_downloader.py")));
}
_tree->create<std::string>(mb_path / "fw_version").set(str(boost::format("%u.%u")
% compat_major % compat_minor));
@@ -1694,11 +1694,11 @@ void x300_impl::check_fpga_compat(const fs_path &mb_path, wb_iface::sptr iface)
"Download the appropriate FPGA images for this version of UHD.\n"
"%s\n\n"
"Then burn a new image to the on-board flash storage of your\n"
- "USRP X3xx device using the burner utility. \n\n"
+ "USRP X3xx device using the burner utility. %s\n\n"
"For more information, refer to the UHD manual:\n\n"
" http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_flash"
) % int(X300_FPGA_COMPAT_MAJOR) % compat_major
- % print_images_error()));
+ % print_utility_error("uhd_images_downloader.py") % print_utility_error("usrp_x3xx_fpga_burner")));
}
_tree->create<std::string>(mb_path / "fpga_version").set(str(boost::format("%u.%u")
% compat_major % compat_minor));