From 377850c9699331a24650a8bc41142627f3ab4330 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Mon, 10 Aug 2015 10:25:15 -0700 Subject: e300: added -DE300_FORCE_NETWORK flag to CMake configuration * Fixes building E300 support in native mode on any Linux system with libudev headers * Added E300_NATIVE check to e300_common.cpp * Improved network mode documentation --- host/docs/usrp_e3x0.dox | 16 +++++++++++++++- host/lib/usrp/e300/CMakeLists.txt | 4 ++-- host/lib/usrp/e300/e300_common.cpp | 16 ++++++++++++++++ host/utils/CMakeLists.txt | 4 ++-- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/host/docs/usrp_e3x0.dox b/host/docs/usrp_e3x0.dox index f34aef229..e6a574a51 100644 --- a/host/docs/usrp_e3x0.dox +++ b/host/docs/usrp_e3x0.dox @@ -134,6 +134,8 @@ which should return 'arm-oe-linux-gnueabi'. $ cmake -DCMAKE_TOOLCHAIN_FILE=/host/cmake/Toolchains/oe-sdk_cross.cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_E300=ON .. $ make +For instructions on building UHD on a PC to interact with your E-Series device, follow these instructions: \ref e3x0_uhd_build + \subsubsection e3x0_sdk_usage_gnuradio Building GNU Radio -# Obtain the gnuradio source code via git. @@ -699,10 +701,22 @@ they can be queried through the API. \subsection e3x0_network_mode Network Mode -Your USRP-E series device can be used in network mode for narrow band signal observation, evaluation and debugging purposes. +Your USRP-E series device can be used in network mode for narrow band signal observation, evaluation and debugging purposes. See the instructions below for how to use network mode. Please note that when compared with normal operation as a standalone device the usable bandwidth is limited and therefore Network Mode is not the recommended mode of operation. +\subsubsection e3x0_uhd_build Building UHD + +To work with your E-Series device in network mode, you will need to build UHD on your PC with extra CMake flags. Assuming you are in the host/build directory, +see below: + + $ cmake -DENABLE_E300=ON -DE300_FORCE_NETWORK=ON .. + $ make + +Once UHD is installed on your device, it will be able to interact with an E-Series device with network mode active (see below). + +\subsubsection e3x0_activating_network Activating Network Mode on the Device + In order to use the device in network mode it is necessary to start the *usrp_e3x0_network_mode* executable on the device. In order to start the executable please log into your device either via SSH or serial console(see \ref e3x0_first_boot) and type diff --git a/host/lib/usrp/e300/CMakeLists.txt b/host/lib/usrp/e300/CMakeLists.txt index 26e34294a..ae817c620 100644 --- a/host/lib/usrp/e300/CMakeLists.txt +++ b/host/lib/usrp/e300/CMakeLists.txt @@ -42,14 +42,14 @@ IF(ENABLE_E300) ${CMAKE_CURRENT_SOURCE_DIR}/e300_remote_codec_ctrl.cpp ) LIBUHD_APPEND_SOURCES(${E300_SOURCES}) - IF(UDEV_FOUND) + IF(UDEV_FOUND AND NOT E300_FORCE_NETWORK) INCLUDE_DIRECTORIES(${UDEV_INCLUDE_DIR}) LIBUHD_APPEND_LIBS(${UDEV_LIBS}) SET_SOURCE_FILES_PROPERTIES( ${E300_SOURCES} PROPERTIES COMPILE_DEFINITIONS "E300_NATIVE=1" ) - ENDIF(UDEV_FOUND) + ENDIF(UDEV_FOUND AND NOT E300_FORCE_NETWORK) IF(ENABLE_GPSD) SET_SOURCE_FILES_PROPERTIES( diff --git a/host/lib/usrp/e300/e300_common.cpp b/host/lib/usrp/e300/e300_common.cpp index 29117e21f..216713bc6 100644 --- a/host/lib/usrp/e300/e300_common.cpp +++ b/host/lib/usrp/e300/e300_common.cpp @@ -29,6 +29,7 @@ #include #include +#ifdef E300_NATIVE namespace uhd { namespace usrp { namespace e300 { namespace common { @@ -90,3 +91,18 @@ UHD_STATIC_BLOCK(register_e300_image_loader) { } }}} + +#else +namespace uhd { namespace usrp { namespace e300 { + +namespace common { + +void load_fpga_image(const std::string&) +{ + throw uhd::assertion_error("load_fpga_image() !E300_NATIVE"); +} + +} + +}}} +#endif diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt index 530bcf087..06bee48cd 100644 --- a/host/utils/CMakeLists.txt +++ b/host/utils/CMakeLists.txt @@ -34,11 +34,11 @@ SET(x3xx_burner_sources ) find_package(UDev) -IF(ENABLE_E300) +IF(ENABLE_E300 AND NOT E300_FORCE_NETWORK) IF(UDEV_FOUND) LIST(APPEND util_runtime_sources usrp_e3x0_network_mode.cpp) ENDIF(UDEV_FOUND) -ENDIF(ENABLE_E300) +ENDIF(ENABLE_E300 AND NOT E300_FORCE_NETWORK) #for each source: build an executable and install FOREACH(util_source ${util_runtime_sources}) -- cgit v1.2.3