From 6eacba0a0e30090963f832ecfeacecfb829757a1 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 20 Apr 2015 13:36:22 -0700 Subject: uhd: Fixed missing include --- host/lib/usrp/common/max287x.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'host/lib') 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 #include #include +#include #include #include "max2870_regs.hpp" #include "max2871_regs.hpp" -- cgit v1.2.3 From eacd36d94d8d9432c09a8ab79884845efeb5fd4b Mon Sep 17 00:00:00 2001 From: Michael Dickens Date: Mon, 20 Apr 2015 14:32:28 -0400 Subject: b200: Boost 1.58-related fixes in B200 IO code. When returning an invalid payload in handle_async_task, Boost 1.58 does not allow NULL to be returned; instead, to be more compatible, use the correct type initialized to (0, []). --- host/lib/usrp/b200/b200_io_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib') 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 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()[1]); switch (sid) { @@ -258,7 +258,7 @@ boost::optional 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()); } /*********************************************************************** -- cgit v1.2.3 From 4e8f0817001d14a9eb2b85f042f185b0c802b6ed Mon Sep 17 00:00:00 2001 From: michael-west Date: Wed, 22 Apr 2015 17:55:43 -0700 Subject: USRP2: Separate FPGA compat numbers for USRP2 and N200. --- host/lib/usrp/usrp2/fw_common.h | 3 ++- host/lib/usrp/usrp2/usrp2_impl.cpp | 25 +++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'host/lib') 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(mb_path / "fpga_version").set(str(boost::format("%u.%u") % fpga_major % fpga_minor)); -- cgit v1.2.3