aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-04-23 12:19:18 -0700
committerAshish Chaudhari <ashish@ettus.com>2015-04-23 12:19:18 -0700
commit5b087a0802a690775536b0101b6881c05b135c42 (patch)
treef015c1fde687602aaf0664a57ae14654003a3919 /host
parent0a103ba2bad243652e8c57732190a18a2ee31d38 (diff)
parent4e8f0817001d14a9eb2b85f042f185b0c802b6ed (diff)
downloaduhd-5b087a0802a690775536b0101b6881c05b135c42.tar.gz
uhd-5b087a0802a690775536b0101b6881c05b135c42.tar.bz2
uhd-5b087a0802a690775536b0101b6881c05b135c42.zip
Merge branch 'maint' into mwest/b200_rev5
Diffstat (limited to 'host')
-rw-r--r--host/CMakeLists.txt6
-rw-r--r--host/lib/usrp/b200/b200_io_impl.cpp4
-rw-r--r--host/lib/usrp/common/max287x.hpp1
-rw-r--r--host/lib/usrp/usrp2/fw_common.h3
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp25
-rw-r--r--host/utils/CMakeLists.txt2
-rw-r--r--host/utils/uhd_usrp_probe.cpp21
-rw-r--r--host/utils/usrp_x3xx_fpga_burner.cpp4
8 files changed, 51 insertions, 15 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 9358b1156..beb4d396f 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -24,7 +24,7 @@
# Project setup
########################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(UHD CXX)
+PROJECT(UHD CXX C)
ENABLE_TESTING()
#make sure our local CMake Modules path comes first
@@ -268,8 +268,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 "8522b02386f5fe0bb51baa3ba0001ef0")
-SET(UHD_IMAGES_DOWNLOAD_SRC "uhd-images_003.008.003-rc1.zip")
+SET(UHD_IMAGES_MD5SUM "57c06338de0504f296a2431762725683")
+SET(UHD_IMAGES_DOWNLOAD_SRC "uhd-images_003.008.003-release.zip")
#}}}
########################################################################
diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp
index cf5ba7a11..3e156f9bb 100644
--- a/host/lib/usrp/b200/b200_io_impl.cpp
+++ b/host/lib/usrp/b200/b200_io_impl.cpp
@@ -194,7 +194,7 @@ boost::optional<uhd::msg_task::msg_type_t> b200_impl::handle_async_task(
{
managed_recv_buffer::sptr buff = xport->get_recv_buff();
if (not buff or buff->size() < 8)
- return NULL;
+ return uhd::msg_task::msg_type_t(0, uhd::msg_task::msg_payload_t());
const boost::uint32_t sid = uhd::wtohx(buff->cast<const boost::uint32_t *>()[1]);
switch (sid) {
@@ -258,7 +258,7 @@ boost::optional<uhd::msg_task::msg_type_t> b200_impl::handle_async_task(
default:
UHD_MSG(error) << "Got a ctrl packet with unknown SID " << sid << std::endl;
}
- return NULL;
+ return uhd::msg_task::msg_type_t(0, uhd::msg_task::msg_payload_t());
}
/***********************************************************************
diff --git a/host/lib/usrp/common/max287x.hpp b/host/lib/usrp/common/max287x.hpp
index aa80600f7..d084dcfbe 100644
--- a/host/lib/usrp/common/max287x.hpp
+++ b/host/lib/usrp/common/max287x.hpp
@@ -25,6 +25,7 @@
#include <boost/assign.hpp>
#include <boost/function.hpp>
#include <boost/thread.hpp>
+#include <boost/math/special_functions/round.hpp>
#include <vector>
#include "max2870_regs.hpp"
#include "max2871_regs.hpp"
diff --git a/host/lib/usrp/usrp2/fw_common.h b/host/lib/usrp/usrp2/fw_common.h
index cfaee0ddc..81dd3523e 100644
--- a/host/lib/usrp/usrp2/fw_common.h
+++ b/host/lib/usrp/usrp2/fw_common.h
@@ -30,7 +30,8 @@ extern "C" {
#endif
//fpga and firmware compatibility numbers
-#define USRP2_FPGA_COMPAT_NUM 11
+#define USRP2_FPGA_COMPAT_NUM 10
+#define N200_FPGA_COMPAT_NUM 11
#define USRP2_FW_COMPAT_NUM 12
#define USRP2_FW_VER_MINOR 4
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 50b8431a1..1acc1dad3 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -395,14 +395,35 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
fpga_major = fpga_minor;
fpga_minor = 0;
}
- if (fpga_major != USRP2_FPGA_COMPAT_NUM){
+ int expected_fpga_compat_num = std::min(USRP2_FPGA_COMPAT_NUM, N200_FPGA_COMPAT_NUM);
+ switch (_mbc[mb].iface->get_rev())
+ {
+ case usrp2_iface::USRP2_REV3:
+ case usrp2_iface::USRP2_REV4:
+ expected_fpga_compat_num = USRP2_FPGA_COMPAT_NUM;
+ break;
+ case usrp2_iface::USRP_N200:
+ case usrp2_iface::USRP_N200_R4:
+ case usrp2_iface::USRP_N210:
+ case usrp2_iface::USRP_N210_R4:
+ expected_fpga_compat_num = N200_FPGA_COMPAT_NUM;
+ break;
+ default:
+ // handle case where the MB EEPROM is not programmed
+ if (fpga_major == USRP2_FPGA_COMPAT_NUM or fpga_major == N200_FPGA_COMPAT_NUM)
+ {
+ UHD_MSG(warning) << "Unable to identify device - assuming USRP2/N-Series device" << std::endl;
+ expected_fpga_compat_num = fpga_major;
+ }
+ }
+ if (fpga_major != expected_fpga_compat_num){
throw uhd::runtime_error(str(boost::format(
"\nPlease update the firmware and FPGA images for your device.\n"
"See the application notes for USRP2/N-Series for instructions.\n"
"Expected FPGA compatibility number %d, but got %d:\n"
"The FPGA build is not compatible with the host code build.\n"
"%s\n"
- ) % int(USRP2_FPGA_COMPAT_NUM) % fpga_major % _mbc[mb].iface->images_warn_help_message()));
+ ) % expected_fpga_compat_num % fpga_major % _mbc[mb].iface->images_warn_help_message()));
}
_tree->create<std::string>(mb_path / "fpga_version").set(str(boost::format("%u.%u") % fpga_major % fpga_minor));
diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt
index ed8640187..e24b417c1 100644
--- a/host/utils/CMakeLists.txt
+++ b/host/utils/CMakeLists.txt
@@ -15,8 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-SET(CMAKE_C_COMPILE_OBJECT ${CMAKE_CXX_COMPILE_OBJECT})
-
########################################################################
# Utilities that get installed into the runtime path
########################################################################
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp
index a03646cc0..f8a8b5665 100644
--- a/host/utils/uhd_usrp_probe.cpp
+++ b/host/utils/uhd_usrp_probe.cpp
@@ -192,7 +192,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("version", "print the version string and exit")
("args", po::value<std::string>()->default_value(""), "device address args")
("tree", "specify to print a complete property tree")
- ("string", po::value<std::string>(), "query a string value from the properties tree")
+ ("string", po::value<std::string>(), "query a string value from the property tree")
+ ("double", po::value<std::string>(), "query a double precision floating point value from the property tree")
+ ("int", po::value<std::string>(), "query a integer value from the property tree")
+ ("range", po::value<std::string>(), "query a range (gain, bandwidth, frequency, ...) from the property tree")
("init-only", "skip all queries, only initialize device")
;
@@ -219,6 +222,22 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
return EXIT_SUCCESS;
}
+ if (vm.count("double")){
+ std::cout << tree->access<double>(vm["double"].as<std::string>()).get() << std::endl;
+ return EXIT_SUCCESS;
+ }
+
+ if (vm.count("int")){
+ std::cout << tree->access<int>(vm["int"].as<std::string>()).get() << std::endl;
+ return EXIT_SUCCESS;
+ }
+
+ if (vm.count("range")){
+ meta_range_t range = tree->access<meta_range_t>(vm["range"].as<std::string>()).get();
+ std::cout << boost::format("%.1f:%.1f:%.1f") % range.start() % range.step() % range.stop() << std::endl;
+ return EXIT_SUCCESS;
+ }
+
if (vm.count("tree") != 0) print_tree("/", tree);
else if (not vm.count("init-only")) std::cout << make_border(get_device_pp_string(tree)) << std::endl;
diff --git a/host/utils/usrp_x3xx_fpga_burner.cpp b/host/utils/usrp_x3xx_fpga_burner.cpp
index e32e4d636..3c6225531 100644
--- a/host/utils/usrp_x3xx_fpga_burner.cpp
+++ b/host/utils/usrp_x3xx_fpga_burner.cpp
@@ -49,13 +49,9 @@
#include <uhd/utils/safe_main.hpp>
#include <uhd/utils/safe_call.hpp>
-#ifdef _MSC_VER
extern "C" {
-#endif
#include "cdecode.h"
-#ifdef _MSC_VER
}
-#endif
#define X300_FPGA_BIN_SIZE_BYTES 15877916
#define X300_FPGA_BIT_MAX_SIZE_BYTES 15878022