summaryrefslogtreecommitdiffstats
path: root/host/utils
diff options
context:
space:
mode:
authorMichael West <michael.west@ettus.com>2013-11-18 10:51:10 -0800
committerMichael West <michael.west@ettus.com>2013-11-18 10:51:10 -0800
commit91c10b31f94f95f1588571e0580b09a8b354a2a3 (patch)
tree0deeb3d2f97f5f9cc31982ad0356caab51d9cb0d /host/utils
parent9b96d4ce44b5d9e90e3ea73d5abf93d35a97b222 (diff)
downloaduhd-91c10b31f94f95f1588571e0580b09a8b354a2a3.tar.gz
uhd-91c10b31f94f95f1588571e0580b09a8b354a2a3.tar.bz2
uhd-91c10b31f94f95f1588571e0580b09a8b354a2a3.zip
BUG #182: Cleaned up for proper dynamic linking of libuhd.
Diffstat (limited to 'host/utils')
-rw-r--r--host/utils/CMakeLists.txt12
-rw-r--r--host/utils/b2xx_fx3_utils.cpp9
2 files changed, 12 insertions, 9 deletions
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