From ed6fc0788832aecd9379e833dd8dee4413b71b38 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 5 Nov 2012 11:45:07 -0800 Subject: wbx v4: fixing the drivers for the new rev of the WBX board --- host/lib/ic_reg_maps/gen_adf4351_regs.py | 20 +++--------- host/lib/usrp/dboard/db_wbx_version4.cpp | 53 ++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/host/lib/ic_reg_maps/gen_adf4351_regs.py b/host/lib/ic_reg_maps/gen_adf4351_regs.py index 607b2979d..4b0ef788c 100755 --- a/host/lib/ic_reg_maps/gen_adf4351_regs.py +++ b/host/lib/ic_reg_maps/gen_adf4351_regs.py @@ -57,7 +57,7 @@ low_noise_and_spur 2[29:30] 3 low_noise, reserved0, reserved1, low ## address 3 ######################################################################## clock_divider_12_bit 3[3:14] 0 -clock_div_mode 3[15:16] 0 clock_divider_off, fast_lock, resync_enable, reserved +clock_div_mode 3[15:16] 1 clock_divider_off, fast_lock, resync_enable, reserved ##reserved 3[17] 0 cycle_slip_reduction 3[18] 0 disabled, enabled ##reserved 3[19:20] 0 @@ -76,7 +76,7 @@ aux_output_select 4[9] 1 divided, fundamental mute_till_lock_detect 4[10] 0 mute_disabled, mute_enabled vco_power_down 4[11] 0 vco_powered_up, vco_powered_down band_select_clock_div 4[12:19] 0 -rf_divider_select 4[20:22] 5 div1, div2, div4, div8, div16, div32, div64 +rf_divider_select 4[20:22] 0 div1, div2, div4, div8, div16, div32, div64 feedback_select 4[23] 1 divided, fundamental ##reserved 4[24:31] 0 ######################################################################## @@ -103,9 +103,9 @@ enum addr_t{ }; boost::uint32_t get_reg(boost::uint8_t addr){ - boost::uint32_t reg = 0; + boost::uint32_t reg = addr & 0x7; switch(addr){ - #for $addr in sorted(set(map(lambda r: r.get_addr(), $regs))) + #for $addr in range(5+1) case $addr: #for $reg in filter(lambda r: r.get_addr() == addr, $regs) reg |= (boost::uint32_t($reg.get_name()) & $reg.get_mask()) << $reg.get_shift(); @@ -115,18 +115,6 @@ boost::uint32_t get_reg(boost::uint8_t addr){ } return reg; } - -void set_reg(boost::uint8_t addr, boost::uint32_t reg){ - switch(addr){ - #for $addr in sorted(set(map(lambda r: r.get_addr(), $regs))) - case $addr: - #for $reg in filter(lambda r: r.get_addr() == addr, $regs) - $reg.get_name() = $(reg.get_type())((reg >> $reg.get_shift()) & $reg.get_mask()); - #end for - break; - #end for - } -} """ if __name__ == '__main__': diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp index 3a85826cd..c1de2af56 100644 --- a/host/lib/usrp/dboard/db_wbx_version4.cpp +++ b/host/lib/usrp/dboard/db_wbx_version4.cpp @@ -115,22 +115,43 @@ wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) { int v4_tx_mod = ADF4351_PDBRF; //set the gpio directions and atr controls - self_base->get_iface()->set_pin_ctrl(dboard_iface::UNIT_TX, v4_tx_mod|v4_iobits); - self_base->get_iface()->set_pin_ctrl(dboard_iface::UNIT_RX, RXBB_PDB|ADF4351_PDBRF); - self_base->get_iface()->set_gpio_ddr(dboard_iface::UNIT_TX, TX_PUP_5V|TX_PUP_3V|v4_tx_mod|v4_iobits); - self_base->get_iface()->set_gpio_ddr(dboard_iface::UNIT_RX, RX_PUP_5V|RX_PUP_3V|ADF4351_CE|RXBB_PDB|ADF4351_PDBRF|RX_ATTN_MASK); - - //setup ATR for the mixer enables (always enabled to prevent phase slip between bursts) - //set TX gain iobits to min gain (max attenuation) when RX_ONLY or IDLE to suppress LO leakage - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_IDLE, v4_tx_mod, TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_RX_ONLY, v4_tx_mod, TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_TX_ONLY, v4_tx_mod, TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_FULL_DUPLEX, v4_tx_mod, TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); - - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_IDLE, RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_TX_ONLY, RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_RX_ONLY, RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); - self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_FULL_DUPLEX, RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); + self_base->get_iface()->set_pin_ctrl(dboard_iface::UNIT_TX, \ + v4_tx_mod|v4_iobits); + self_base->get_iface()->set_pin_ctrl(dboard_iface::UNIT_RX, \ + RXBB_PDB|ADF4351_PDBRF); + self_base->get_iface()->set_gpio_ddr(dboard_iface::UNIT_TX, \ + TX_PUP_5V|TX_PUP_3V|v4_tx_mod|v4_iobits); + self_base->get_iface()->set_gpio_ddr(dboard_iface::UNIT_RX, \ + RX_PUP_5V|RX_PUP_3V|ADF4351_CE|RXBB_PDB|ADF4351_PDBRF|RX_ATTN_MASK); + + //setup ATR for the mixer enables (always enabled to prevent phase slip + //between bursts) set TX gain iobits to min gain (max attenuation) when + //RX_ONLY or IDLE to suppress LO leakage + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, \ + dboard_iface::ATR_REG_IDLE, v4_tx_mod, \ + TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, \ + dboard_iface::ATR_REG_RX_ONLY, v4_tx_mod, \ + TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, \ + dboard_iface::ATR_REG_TX_ONLY, v4_tx_mod, \ + TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, \ + dboard_iface::ATR_REG_FULL_DUPLEX, v4_tx_mod, \ + TX_ATTN_MASK | TX_MIXER_DIS | v4_tx_mod); + + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, \ + dboard_iface::ATR_REG_IDLE, \ + RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, \ + dboard_iface::ATR_REG_TX_ONLY, \ + RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, \ + dboard_iface::ATR_REG_RX_ONLY, \ + RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); + self_base->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, \ + dboard_iface::ATR_REG_FULL_DUPLEX, \ + RX_MIXER_ENB, RX_MIXER_DIS | RX_MIXER_ENB); } wbx_base::wbx_version4::~wbx_version4(void){ -- cgit v1.2.3 From 5d0a0631cad9cd16c14e6c5209ab0ce3bf9c53e4 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 5 Nov 2012 12:48:33 -0800 Subject: wbx: updating the code to allow full range of the VCO. --- host/lib/usrp/dboard/db_wbx_version4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp index c1de2af56..2fc3416ee 100644 --- a/host/lib/usrp/dboard/db_wbx_version4.cpp +++ b/host/lib/usrp/dboard/db_wbx_version4.cpp @@ -41,7 +41,7 @@ static const uhd::dict wbx_v4_tx_gain_ranges = map_li ("PGA0", gain_range_t(0, 31, 1.0)) ; -static const freq_range_t wbx_v4_freq_range(50.0e6, 2.2e9); +static const freq_range_t wbx_v4_freq_range(35.0e6, 2.2e9); /*********************************************************************** -- cgit v1.2.3 From a3f18afa672d4f14b8982e5666de920e9bc08f7e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 9 Nov 2012 16:16:18 -0800 Subject: uhd: make stream cmd enums easier on SWIG --- host/include/uhd/types/stream_cmd.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/host/include/uhd/types/stream_cmd.hpp b/host/include/uhd/types/stream_cmd.hpp index 41708e2e2..3c34c9656 100644 --- a/host/include/uhd/types/stream_cmd.hpp +++ b/host/include/uhd/types/stream_cmd.hpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2012 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -46,10 +46,10 @@ namespace uhd{ struct UHD_API stream_cmd_t{ enum stream_mode_t { - STREAM_MODE_START_CONTINUOUS = 'a', - STREAM_MODE_STOP_CONTINUOUS = 'o', - STREAM_MODE_NUM_SAMPS_AND_DONE = 'd', - STREAM_MODE_NUM_SAMPS_AND_MORE = 'm' + STREAM_MODE_START_CONTINUOUS = int('a'), + STREAM_MODE_STOP_CONTINUOUS = int('o'), + STREAM_MODE_NUM_SAMPS_AND_DONE = int('d'), + STREAM_MODE_NUM_SAMPS_AND_MORE = int('m') } stream_mode; size_t num_samps; -- cgit v1.2.3 From 398c5413ea917b0e567e4bf2534f1d6c8f7ce9cc Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Sat, 10 Nov 2012 15:39:31 -0800 Subject: utils: fixed Windows images downloader bug --- host/utils/uhd_images_downloader.py.in | 111 +++++++++++++++++---------------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/host/utils/uhd_images_downloader.py.in b/host/utils/uhd_images_downloader.py.in index 59c0fbafe..a57f9dc48 100644 --- a/host/utils/uhd_images_downloader.py.in +++ b/host/utils/uhd_images_downloader.py.in @@ -26,6 +26,14 @@ import tempfile import urllib2 import zipfile +class temp_dir(): + + def __enter__(self): + self.name = tempfile.mkdtemp() + return self.name + def __exit__(self, type, value, traceback): + os.removedirs(self.name) + if __name__ == "__main__": #Command line options @@ -38,65 +46,62 @@ if __name__ == "__main__": images_src = "@UHD_IMAGES_DOWNLOAD_SRC@" filename = images_src.split("/")[-1] - #Create temporary directory - download_dir = tempfile.mkdtemp() - atexit.register(lambda: shutil.rmtree(download_dir)) - - #Make sure we download into the correct directory - os.chdir(download_dir) + with temp_dir() as dirname: + os.chdir(dirname) - #Configuring image destination - if options.install_location != "": - images_dir = options.install_location - else: - images_dir = "@CMAKE_INSTALL_PREFIX@/share/uhd/images" - - u = urllib2.urlopen(images_src) - f = open(filename, "wb") - meta = u.info() - filesize = float(meta.getheaders("Content-Length")[0]) - - print "Downloading images from: %s" % images_src - - filesize_dl = 0.0 + #Configuring image destination + if options.install_location != "": + images_dir = options.install_location + else: + images_dir = "@CMAKE_INSTALL_PREFIX@/share/uhd/images" + + u = urllib2.urlopen(images_src) + f = open(filename, "wb") + meta = u.info() + filesize = float(meta.getheaders("Content-Length")[0]) + + print "Downloading images from: %s" % images_src + + filesize_dl = 0.0 - #Downloading file - while True: - buffer = u.read(options.buffer_size) - if not buffer: - break - - filesize_dl -= len(buffer) - f.write(buffer) + #Downloading file + while True: + buffer = u.read(options.buffer_size) + if not buffer: + break + + filesize_dl -= len(buffer) + f.write(buffer) - status = r"%2.2f MB/%2.2f MB (%3.2f" % (-filesize_dl/1e6, filesize/1e6, (-filesize_dl*100.)/filesize) + r"%)" - status += chr(8)*(len(status)+1) - print status, - - f.close() + status = r"%2.2f MB/%2.2f MB (%3.2f" % (-filesize_dl/1e6, filesize/1e6, (-filesize_dl*100.)/filesize) + r"%)" + status += chr(8)*(len(status)+1) + print status, + + f.close() - #Extracting contents of zip file - if os.path.exists("tempdir"): - shutil.rmtree("tempdir") - os.mkdir("tempdir") + #Extracting contents of zip file + if os.path.exists("tempdir"): + shutil.rmtree("tempdir") + os.mkdir("tempdir") - images_zip = zipfile.ZipFile(filename) - images_zip.extractall("tempdir") + images_zip = zipfile.ZipFile(filename) + images_zip.extractall("tempdir") - #Removing images currently in images_dir - if os.path.exists(images_dir): - try: - shutil.rmtree(images_dir) - except: - sys.stderr.write("\nMake sure you have write permissions in the images directory.\n") - sys.exit(0) + #Removing images currently in images_dir + if os.path.exists(images_dir): + try: + shutil.rmtree(images_dir) + except: + sys.stderr.write("\nMake sure you have write permissions in the images directory.\n") + sys.exit(0) - #Copying downloaded images into images_dir - shutil.copytree("tempdir/%s/share/uhd/images" % filename[:-4],images_dir) + #Copying downloaded images into images_dir + shutil.copytree("tempdir/%s/share/uhd/images" % filename[:-4],images_dir) - #Removing tempdir and zip file - shutil.rmtree("tempdir") - images_zip.close() - os.remove(filename) + #Removing tempdir and zip file + shutil.rmtree("tempdir") + images_zip.close() + os.remove(filename) - print "\nImages successfully installed to: %s" % images_dir + os.chdir(images_dir) + print "\nImages successfully installed to: %s" % images_dir -- cgit v1.2.3 From 8ea5966f7abbfcc12ec38a3d4532929762c80064 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Mon, 12 Nov 2012 09:34:06 -0800 Subject: cmake: UHD_RELEASE_MODE is now cached and no longer resets between CMake runs --- host/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 55fd5630f..ba532eed2 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -71,7 +71,7 @@ ENDIF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "") #force UHD_RELEASE_MODE to be a string for cmake-gui -SET(UHD_RELEASE_MODE CACHE STRING "${UHD_RELEASE_MODE}" FORCE) +SET(UHD_RELEASE_MODE "${UHD_RELEASE_MODE}" CACHE STRING "UHD Release Mode") IF(CMAKE_COMPILER_IS_GNUCXX) ADD_DEFINITIONS(-Wall) -- cgit v1.2.3 From 4901ecdaf2a87f54ed4f589e86f0fdd7060ea6a0 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Mon, 12 Nov 2012 12:02:46 -0800 Subject: docs: documentation introduces images-related features introduced in 003.005.000 --- host/docs/images.rst | 13 ++++++++++++- host/docs/usrp2.rst | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/host/docs/images.rst b/host/docs/images.rst index eaddfdf1d..dc9770460 100644 --- a/host/docs/images.rst +++ b/host/docs/images.rst @@ -24,7 +24,6 @@ Pre-built images are available for download. * `Master Branch images `_ * `Maint Branch images `_ -* `Next Branch images `_ See the UHD wiki for the download link. @@ -33,6 +32,18 @@ The pre-built images come in two forms: * bundled with UHD in a platform-specific installer * stand-alone platform-independent archive files +^^^^^^^^^^^^^^^^^^^^^^ +UHD Images Downloader +^^^^^^^^^^^^^^^^^^^^^^ + +The UHD Images Downloader is a new feature in UHD 003.005.000. This script downloads UHD images that +are guaranteed to be compatible with the host code and places them in the default images +directory. + +By default, it can be found at: **/share/uhd/utils/uhd_images_downloader.py** + +By default, it installs images to: **/share/uhd/images** + ^^^^^^^^^^^^^^^^^^^^^^ Platform installers ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/host/docs/usrp2.rst b/host/docs/usrp2.rst index 8e9aa6d50..075a9684e 100644 --- a/host/docs/usrp2.rst +++ b/host/docs/usrp2.rst @@ -93,6 +93,17 @@ Use the net burner tool (Windows) /share/uhd/utils/usrp_n2xx_net_burner_gui.py +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Burning images without Python +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For users who do not wish to install Python, a new script is available in UHD 003.005.000: +the USRP N2XX Simple Net Burner. It provides the same functionality as its Python +counterpart, but by default, it automatically installs the default images without the user needing +to specify their location on the command line. + +The utility can be found at: **/share/uhd/utils/usrp_n2xx_simple_net_burner** + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Device recovery and bricking ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- cgit v1.2.3