From a28099fe4abe10b11c9234d67b243adbd20ce1a1 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 19 Apr 2011 09:36:53 -0700 Subject: usrp2: improve the compatibility error messages --- host/lib/usrp/usrp2/mboard_impl.cpp | 6 ++++-- host/lib/usrp/usrp2/usrp2_iface.cpp | 9 +++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 7a6c596bc..29e0535f8 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -71,8 +71,10 @@ usrp2_mboard_impl::usrp2_mboard_impl( const boost::uint32_t fpga_compat_num = _iface->peek32(_iface->regs.compat_num_rb); if (fpga_compat_num != USRP2_FPGA_COMPAT_NUM){ throw uhd::runtime_error(str(boost::format( - "Expected fpga compatibility number %d, but got %d:\n" - "The fpga build is not compatible with the host code build." + "\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." ) % int(USRP2_FPGA_COMPAT_NUM) % fpga_compat_num)); } diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index 6b3409ecc..d88d31765 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -242,11 +242,6 @@ public: ){ boost::mutex::scoped_lock lock(_ctrl_mutex); - std::string range = (lo == hi)? - str(boost::format("%d") % hi) : - str(boost::format("[%d to %d]") % lo % hi) - ; - //fill in the seq number and send usrp2_ctrl_data_t out_copy = out_data; out_copy.proto_ver = htonl(_protocol_compat); @@ -261,9 +256,11 @@ public: boost::uint32_t compat = ntohl(ctrl_data_in->proto_ver); if(len >= sizeof(boost::uint32_t) and (hi < compat or lo > compat)){ 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 protocol compatibility number %s, but got %d:\n" "The firmware build is not compatible with the host code build." - ) % range % compat)); + ) % ((lo == hi)? (boost::format("%d") % hi) : (boost::format("[%d to %d]") % lo % hi)) % compat)); } if (len >= sizeof(usrp2_ctrl_data_t) and ntohl(ctrl_data_in->seq) == _ctrl_seq_num){ return *ctrl_data_in; -- cgit v1.2.3