From 2f102fbff2b7245d3d038e7dfffaa2de856b61aa Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 8 Apr 2011 16:59:29 -0500 Subject: usrp2: support fw protos with older compats for various parts i2c, spi, and uart are long time no changing registers changed recently (think re-map) also, perform the fpga compat check in the make now we can find devices with out of date images --- host/lib/usrp/usrp2/mboard_impl.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'host/lib/usrp/usrp2/mboard_impl.cpp') diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 40fc5098b..7a6c596bc 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -66,6 +66,16 @@ usrp2_mboard_impl::usrp2_mboard_impl( device_addr["addr"], BOOST_STRINGIZE(USRP2_UDP_CTRL_PORT) ))) { + + //check the fpga compatibility number + 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." + ) % int(USRP2_FPGA_COMPAT_NUM) % fpga_compat_num)); + } + //construct transports for dsp and async errors std::cout << "Making transport for DSP0..." << std::endl; device.dsp_xports.push_back(udp_zero_copy::make( -- cgit v1.2.3