aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-11-09 18:13:25 -0800
committerPhilip Balister <philip@opensdr.com>2010-11-09 18:13:25 -0800
commit7824f130bd1296c78f5b0311d1c253f0476c6cab (patch)
tree22bd18d3d8f574d295232993633c0e56543915dd /host
parentbab641f4fdf954d6023904ca18c4bb4f6a362e47 (diff)
downloaduhd-7824f130bd1296c78f5b0311d1c253f0476c6cab.tar.gz
uhd-7824f130bd1296c78f5b0311d1c253f0476c6cab.tar.bz2
uhd-7824f130bd1296c78f5b0311d1c253f0476c6cab.zip
usrp_e : Unload the module before loading the FPGA. Reload after the fpga is loaded.
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp_e/fpga-downloader.cc6
-rw-r--r--host/lib/usrp/usrp_e/usrp_e_impl.cpp6
2 files changed, 10 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp_e/fpga-downloader.cc b/host/lib/usrp/usrp_e/fpga-downloader.cc
index b0d56e856..5fd2c8dd0 100644
--- a/host/lib/usrp/usrp_e/fpga-downloader.cc
+++ b/host/lib/usrp/usrp_e/fpga-downloader.cc
@@ -259,9 +259,15 @@ void usrp_e_load_fpga(const std::string &bin_file){
std::cout << "Loading FPGA image: " << bin_file << "... " << std::flush;
+ system("/sbin/rmmod usrp_e");
+
prepare_fpga_for_configuration(gpio_prog_b, gpio_init_b);
std::cout << "done = " << gpio_done.get_value() << std::endl;
send_file_to_fpga(bin_file, gpio_init_b, gpio_done);
+
+ system("/sbin/modprobe usrp_e");
+
}
+
diff --git a/host/lib/usrp/usrp_e/usrp_e_impl.cpp b/host/lib/usrp/usrp_e/usrp_e_impl.cpp
index cd39dbb07..70cc399fb 100644
--- a/host/lib/usrp/usrp_e/usrp_e_impl.cpp
+++ b/host/lib/usrp/usrp_e/usrp_e_impl.cpp
@@ -111,8 +111,10 @@ static device::sptr usrp_e_make(const device_addr_t &device_addr){
//if not loaded: load the fpga image and write the hash-file
if (fpga_compat_num != USRP_E_COMPAT_NUM or loaded_hash != fpga_hash){
-// usrp_e_load_fpga(usrp_e_fpga_image);
-std::cout << "Here is where I load the fpga" << std::endl;
+ iface.reset();
+ usrp_e_load_fpga(usrp_e_fpga_image);
+ std::cout << boost::format("re-Opening USRP-E on %s") % node << std::endl;
+ iface = usrp_e_iface::make(node);
try{std::ofstream(hash_file_path) << fpga_hash;}catch(...){}
}