diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/b200/b200_iface.hpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/b200/b200_impl.hpp | 4 | ||||
-rw-r--r-- | host/utils/CMakeLists.txt | 12 | ||||
-rw-r--r-- | host/utils/b2xx_fx3_utils.cpp | 9 |
4 files changed, 18 insertions, 15 deletions
diff --git a/host/lib/usrp/b200/b200_iface.hpp b/host/lib/usrp/b200/b200_iface.hpp index 6ba77f0ff..4b678b1f9 100644 --- a/host/lib/usrp/b200/b200_iface.hpp +++ b/host/lib/usrp/b200/b200_iface.hpp @@ -31,7 +31,11 @@ const static boost::uint16_t FX3_VID = 0x04b4; const static boost::uint16_t FX3_DEFAULT_PID = 0x00f3; const static boost::uint16_t FX3_REENUM_PID = 0x00f0; -class b200_iface: boost::noncopyable, public virtual uhd::i2c_iface, +static const std::string B200_FW_FILE_NAME = "usrp_b200_fw.hex"; +static const std::string B200_FPGA_FILE_NAME = "usrp_b200_fpga.bin"; +static const std::string B210_FPGA_FILE_NAME = "usrp_b210_fpga.bin"; + +class UHD_API b200_iface: boost::noncopyable, public virtual uhd::i2c_iface, public ad9361_ctrl_iface_type { public: typedef boost::shared_ptr<b200_iface> sptr; @@ -41,7 +45,7 @@ public: * \param usb_ctrl a USB control transport * \return a new b200 interface object */ - static sptr make(uhd::transport::usb_control::sptr usb_ctrl); + static UHD_API sptr make(uhd::transport::usb_control::sptr usb_ctrl); //! query the device USB speed (2, 3) virtual boost::uint8_t get_usb_speed(void) = 0; diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index eced4a539..d96130dda 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -44,10 +44,6 @@ #include <uhd/transport/bounded_buffer.hpp> #include <boost/weak_ptr.hpp> #include "recv_packet_demuxer_3000.hpp" - -static const std::string B200_FW_FILE_NAME = "usrp_b200_fw.hex"; -static const std::string B200_FPGA_FILE_NAME = "usrp_b200_fpga.bin"; -static const std::string B210_FPGA_FILE_NAME = "usrp_b210_fpga.bin"; static const boost::uint8_t B200_FW_COMPAT_NUM_MAJOR = 0x03; static const boost::uint8_t B200_FW_COMPAT_NUM_MINOR = 0x00; static const boost::uint16_t B200_FPGA_COMPAT_NUM = 0x02; diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt index 1135ad031..f73690475 100644 --- a/host/utils/CMakeLists.txt +++ b/host/utils/CMakeLists.txt @@ -47,8 +47,11 @@ SET(util_share_sources IF(ENABLE_USB) LIST(APPEND util_share_sources fx2_init_eeprom.cpp + b2xx_fx3_utils ) INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS}) + # Additional include directories for b2xx_fx3_utils + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../lib/usrp/b200 ${CMAKE_CURRENT_SOURCE_DIR}/../lib/usrp/common) ENDIF(ENABLE_USB) IF(LINUX AND ENABLE_USB) @@ -67,15 +70,6 @@ FOREACH(util_source ${util_share_sources}) UHD_INSTALL(TARGETS ${util_name} RUNTIME DESTINATION ${PKG_LIB_DIR}/utils COMPONENT utilities) ENDFOREACH(util_source) -IF(ENABLE_USB) - # build b2xx_fx3_utils - INCLUDE_DIRECTORIES(../lib/usrp/b200) - INCLUDE_DIRECTORIES(../lib/usrp/common) - ADD_EXECUTABLE(b2xx_fx3_utils ../lib/transport/libusb1_base.cpp ../lib/usrp/b200/b200_iface.cpp b2xx_fx3_utils.cpp) - TARGET_LINK_LIBRARIES(b2xx_fx3_utils uhd ${Boost_LIBRARIES}) - UHD_INSTALL(TARGETS b2xx_fx3_utils RUNTIME DESTINATION ${PKG_LIB_DIR}/utils COMPONENT utilities) -ENDIF(ENABLE_USB) - UHD_INSTALL(TARGETS usrp_n2xx_simple_net_burner RUNTIME DESTINATION ${PKG_LIB_DIR}/utils COMPONENT utilities) #UHD images downloader configuration diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index e910ffc6c..d4e3b0f9a 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -38,6 +38,7 @@ #include <uhd/transport/usb_control.hpp> #include <uhd/transport/usb_device_handle.hpp> #include <uhd/exception.hpp> +#include <uhd/utils/images.hpp> namespace po = boost::program_options; namespace fs = boost::filesystem; @@ -182,6 +183,8 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { if (!(handles[0]->firmware_loaded())) { + if (fw_file.empty()) + fw_file = uhd::find_image_path(B200_FW_FILE_NAME); b200->load_firmware(fw_file); // Now that the firmware is loaded, we need to re-open the device @@ -229,6 +232,8 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { if (!(handles[0]->firmware_loaded())) { // load FW + if (fw_file.empty()) + fw_file = uhd::find_image_path(B200_FW_FILE_NAME); b200->load_firmware(fw_file); // re-open device @@ -309,6 +314,8 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { if (!(handles[0]->firmware_loaded())) { + if (fw_file.empty()) + fw_file = uhd::find_image_path(B200_FW_FILE_NAME); b200->load_firmware(fw_file); // Now that the firmware is loaded, we need to re-open the device @@ -384,6 +391,8 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { if (!(handles[0]->firmware_loaded())) { // load FW + if (fw_file.empty()) + fw_file = uhd::find_image_path(B200_FW_FILE_NAME); b200->load_firmware(fw_file); // re-open device |