From 94c450b32538272d714ec3b9da27e45152f6a099 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 27 Aug 2010 15:51:18 -0700 Subject: usrp1: some app notes --- host/docs/usrp1.rst | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 host/docs/usrp1.rst (limited to 'host/docs/usrp1.rst') diff --git a/host/docs/usrp1.rst b/host/docs/usrp1.rst new file mode 100644 index 000000000..ebc33cbfa --- /dev/null +++ b/host/docs/usrp1.rst @@ -0,0 +1,41 @@ +======================================================================== +UHD - USRP1 Application Notes +======================================================================== + +.. contents:: Table of Contents + +------------------------------------------------------------------------ +Addressing the device +------------------------------------------------------------------------ +A USRP1 can be identified though its serial number, +designated by the "serial" key in the device address. + +The device address string representation for a USRP1 with serial 1234 + +:: + + serial=1234 + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Change the USRP1's serial number +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TODO + +------------------------------------------------------------------------ +OS Specific Notes +------------------------------------------------------------------------ + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Setup Udev on Linux +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +On Linux, Udev handles USB plug and unplug events. +The following command creates a Udev rule for the USRP1 +so that non-root users may access the device: + +:: + + echo 'ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002", MODE:="0666"' > tmpfile + sudo chown root.root tmpfile + sudo mv tmpfile /etc/udev/rules.d/10-usrp.rules + sudo udevadm control --reload-rules + -- cgit v1.2.3 From f5c62a46cbc44e254c0214b463d51f06675c17ab Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 30 Aug 2010 16:54:18 -0700 Subject: usrp1: subdev spec tweaks and docs --- host/docs/usrp1.rst | 35 +++++++++++++++++++++++++++++++++++ host/include/uhd/usrp/subdev_spec.hpp | 9 --------- host/lib/usrp/misc_utils.cpp | 13 +++++++++++-- 3 files changed, 46 insertions(+), 11 deletions(-) (limited to 'host/docs/usrp1.rst') diff --git a/host/docs/usrp1.rst b/host/docs/usrp1.rst index ebc33cbfa..c960b928b 100644 --- a/host/docs/usrp1.rst +++ b/host/docs/usrp1.rst @@ -21,6 +21,41 @@ Change the USRP1's serial number ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO +------------------------------------------------------------------------ +Specifying the subdevice to use +------------------------------------------------------------------------ +The USRP1 has multiple daughterboard slots, known as slot A and slot B. +The subdevice specification can be used to select +the daughterboard and subdevice for each channel. +For daughterboards with one one subdevice, +the subdevice name may be left blank for automatic selection. + +Ex: The subdev spec markup string to select a WBX on slot B. +Notice the use of the blank subdevice name for automatic selection. + +:: + + B: + + -- OR -- + + B:0 + +Ex: The subdev spec markup string to select a BasicRX on slot B. +Notice that the subdevice name is always specified in the 3 possible cases. + +:: + + B:AB + + -- OR -- + + B:A + + -- OR -- + + B:B + ------------------------------------------------------------------------ OS Specific Notes ------------------------------------------------------------------------ diff --git a/host/include/uhd/usrp/subdev_spec.hpp b/host/include/uhd/usrp/subdev_spec.hpp index 56aa0df20..2f32509b9 100644 --- a/host/include/uhd/usrp/subdev_spec.hpp +++ b/host/include/uhd/usrp/subdev_spec.hpp @@ -56,17 +56,8 @@ namespace uhd{ namespace usrp{ * * The subdevice specification can be represented as a markup-string. * The markup-string is a whitespace separated list of dboard:subdev pairs. - * The "dboard:" part is optional on boards with only one daughterboard slot. * The first pair represents the subdevice for channel zero, * the second pair represents the subdevice for channel one, and so on. - * - * Examples: - * - Use subdevice AB on daughterboard A (USRP1): "A:AB" - * - Use subdevice A on daughterboard A for channel zero and subdevice A on daughterboard B for channel one (USRP1): "A:A B:A" - * - Use subdevice AB (USRP2): "AB" or ":AB" - * - * An empty subdevice specification can be used to automatically - * select the first subdevice on the first present daughterboard. */ class UHD_API subdev_spec_t : public std::vector{ public: diff --git a/host/lib/usrp/misc_utils.cpp b/host/lib/usrp/misc_utils.cpp index a1664d810..5cfcdc8d3 100644 --- a/host/lib/usrp/misc_utils.cpp +++ b/host/lib/usrp/misc_utils.cpp @@ -164,13 +164,22 @@ static void verify_xx_subdev_spec( //empty db name means select dboard automatically if (pair.db_name.empty()){ if (dboard_names.size() != 1) throw std::runtime_error( - "A daughterboard name must be provided for multi-slot boards: " + subdev_spec.to_string() + "A daughterboard name must be provided for multi-slot motherboards: " + subdev_spec.to_string() ); pair.db_name == dboard_names.front(); } uhd::assert_has(dboard_names, pair.db_name, xx_type + " dboard name"); wax::obj dboard = mboard[named_prop_t(dboard_prop, pair.db_name)]; - uhd::assert_has(dboard[DBOARD_PROP_SUBDEV_NAMES].as(), pair.sd_name, xx_type + " subdev name"); + prop_names_t subdev_names = dboard[DBOARD_PROP_SUBDEV_NAMES].as(); + + //empty sd name means select the subdev automatically + if (pair.sd_name.empty()){ + if (subdev_names.size() != 1) throw std::runtime_error( + "A subdevice name must be provided for multi-subdev daughterboards: " + subdev_spec.to_string() + ); + pair.sd_name == subdev_names.front(); + } + uhd::assert_has(subdev_names, pair.sd_name, xx_type + " subdev name"); } }catch(const std::exception &e){ throw std::runtime_error(str(boost::format( -- cgit v1.2.3 From 5058145dcc5cb681887773b8245cf89df58399f9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 31 Aug 2010 18:11:13 -0700 Subject: usrp1: added docs and author --- host/AUTHORS | 4 ++++ host/docs/usrp1.rst | 49 ++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 5 deletions(-) (limited to 'host/docs/usrp1.rst') diff --git a/host/AUTHORS b/host/AUTHORS index 7292da8f9..e0775f3a1 100644 --- a/host/AUTHORS +++ b/host/AUTHORS @@ -23,3 +23,7 @@ Tom Tsou - ttsou@vt.edu LIBUSB host code USRP1 host code USRP1 firmware + +Nick Foster - nick@nerdnetworks.org + LIBUSB host code + USRP1 host code diff --git a/host/docs/usrp1.rst b/host/docs/usrp1.rst index c960b928b..3c1431d30 100644 --- a/host/docs/usrp1.rst +++ b/host/docs/usrp1.rst @@ -7,19 +7,58 @@ UHD - USRP1 Application Notes ------------------------------------------------------------------------ Addressing the device ------------------------------------------------------------------------ -A USRP1 can be identified though its serial number, +A USRP1 can be identified though its 8 digit serial number, designated by the "serial" key in the device address. -The device address string representation for a USRP1 with serial 1234 +The device address string representation for a USRP1 with serial 12345678: :: - serial=1234 + serial=12345678 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Change the USRP1's serial number +Change the serial number ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -TODO +The USRP1 serial number can be changed to any 8 byte string. Examples: + +:: + + cd /share/uhd/utils + ./usrp1_serial_burner --new=87654321 + + -- OR -- + + ./usrp1_serial_burner --new=Beatrice + + -- OR -- + + ./usrp1_serial_burner --old=12345678 --new=87654321 + +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Specify a non-standard image +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The standard USRP1 images installer comes with two FPGA images: + * **usrp1_fpga.rbf:** 2 DDCs + 2 DUCs + * **usrp1_fpga_4rx.rbf:** 4 DDCs + 0 DUCs + +By default, the USRP1 uses the FPGA image with 2 DDCs and 2 DUCs. +However, a device address parameter can be used to override +the FPGA image selection to use an alternate or a custom FPGA image. +See the images application notes for installing custom images. + +Example device address string representations to specify non-standard firmware and/or FPGA images: + +:: + + fpga=usrp1_fpga_4rx.rbf + + -- OR -- + + fw=usrp1_fw_custom.ihx + + -- OR -- + + fpga=usrp1_fpga_4rx.rbf, fw=usrp1_fw_custom.ihx ------------------------------------------------------------------------ Specifying the subdevice to use -- cgit v1.2.3