aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorThomas Vogel <thomas.vogel@ni.com>2019-03-14 16:02:20 +0100
committerBrent Stapleton <brent.stapleton@ettus.com>2019-04-03 16:17:35 -0700
commit4c6caeb111fe52d92f1ccf0aedf9d96230051c6c (patch)
tree0524f79adb589993c01e46566f2c398ebb933c65 /host/lib/usrp
parent164d76dcfdefe888d0e152d33827187d3d47b57e (diff)
downloaduhd-4c6caeb111fe52d92f1ccf0aedf9d96230051c6c.tar.gz
uhd-4c6caeb111fe52d92f1ccf0aedf9d96230051c6c.tar.bz2
uhd-4c6caeb111fe52d92f1ccf0aedf9d96230051c6c.zip
X300: add capability to flash NI-2974 FPGA
The NI-2974 has a X310 inside but reports a different "product" when polled. This prevents the image_loader from flashing a new FPGA image, this patch enables this.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/x300/x300_image_loader.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_image_loader.cpp b/host/lib/usrp/x300/x300_image_loader.cpp
index 5cb1f1b85..28ea699f5 100644
--- a/host/lib/usrp/x300/x300_image_loader.cpp
+++ b/host/lib/usrp/x300/x300_image_loader.cpp
@@ -228,10 +228,15 @@ static void x300_setup_session(x300_session_t& session,
if (!session.dev_addr.has_key("product") or session.fpga_type == "") {
throw uhd::runtime_error(
"Found a device but could not auto-generate an image filename.");
- } else
+ } else {
+ std::string fpga_file_type = to_lower_copy(session.dev_addr["product"]);
+ if (fpga_file_type == "ni-2974") {
+ fpga_file_type = "x310";
+ }
session.filepath = find_image_path(
str(boost::format("usrp_%s_fpga_%s.bit")
- % (to_lower_copy(session.dev_addr["product"])) % session.fpga_type));
+ % fpga_file_type % session.fpga_type));
+ }
} else
session.filepath = filepath;