aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/octoclock_firmware_burner.cpp
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2015-07-15 09:32:18 -0700
committerNicholas Corgan <nick.corgan@ettus.com>2015-07-15 09:32:18 -0700
commit0595900eccfffee9e944dc53466337b44655caac (patch)
tree7db7ee8e908b604236b04cf49f3d8d978e386543 /host/utils/octoclock_firmware_burner.cpp
parent012381d999c4a895593412aaf06e73432b458810 (diff)
downloaduhd-0595900eccfffee9e944dc53466337b44655caac.tar.gz
uhd-0595900eccfffee9e944dc53466337b44655caac.tar.bz2
uhd-0595900eccfffee9e944dc53466337b44655caac.zip
Added uhd::image_loader class and uhd_image_loader utility
* Single class for loading firmware/FPGA images onto devices instead of multiple utilities * Loading functions are registered for each device, corresponding to their --args="type=foo" name * Deprecation warnings added to all product-specific image loading utilities
Diffstat (limited to 'host/utils/octoclock_firmware_burner.cpp')
-rw-r--r--host/utils/octoclock_firmware_burner.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/host/utils/octoclock_firmware_burner.cpp b/host/utils/octoclock_firmware_burner.cpp
index eb8198a2b..1ec77d0c8 100644
--- a/host/utils/octoclock_firmware_burner.cpp
+++ b/host/utils/octoclock_firmware_burner.cpp
@@ -104,6 +104,28 @@ void list_octoclocks(){
}
}
+void print_image_loader_warning(const std::string &fw_path, const po::variables_map &vm){
+ // Newline + indent
+ #ifdef UHD_PLATFORM_WIN32
+ const std::string nl = " ^\n ";
+ #else
+ const std::string nl = " \\\n ";
+ #endif
+
+ std::string uhd_image_loader = str(boost::format("uhd_image_loader --args=\"type=octoclock,addr=%s\""
+ "%s --fw-path=%s")
+ % vm["addr"].as<std::string>() % nl % fw_path);
+
+ std::cout << "************************************************************************************************" << std::endl
+ << "WARNING: This utility will be removed in an upcoming version of UHD. In the future, use" << std::endl
+ << " this command:" << std::endl
+ << std::endl
+ << uhd_image_loader << std::endl
+ << std::endl
+ << "************************************************************************************************" << std::endl
+ << std::endl;
+}
+
/*
* Manually find bootloader. This sends multiple packets in order to increase chances of getting
* bootloader before it switches to the application.
@@ -363,6 +385,8 @@ int UHD_SAFE_MAIN(UHD_UNUSED(int argc), UHD_UNUSED(char *argv[])){
read_firmware();
+ print_image_loader_warning(firmware_path, vm);
+
std::signal(SIGINT, &sig_int_handler);
burn_firmware(udp_transport);