host: mpmd based uhd_image_loader: fallback to .bin file

If the expected FPGA image with .bit file ending is not available,
try with .bin file ending.

Co-authored-by: Lars Amsel <lars.amsel@emerson.com>
This commit is contained in:
Jörg Hofrichter 2026-07-13 13:33:25 +02:00 committed by mkoop-ni
parent aa2665d6f4
commit 2618b51cb8

View File

@ -202,14 +202,17 @@ static std::string get_fpga_path(
if (!dev_addr.has_key("product")) {
throw uhd::runtime_error("Found a device but could not "
"auto-generate an image filename.");
} else if (fpga_type.empty()) {
return find_image_path("usrp_"
+ boost::algorithm::to_lower_copy(dev_addr["product"])
+ "_fpga.bit");
} else {
return find_image_path("usrp_"
+ boost::algorithm::to_lower_copy(dev_addr["product"])
+ "_fpga_" + fpga_type + ".bit");
std::string base_name =
"usrp_" + boost::algorithm::to_lower_copy(dev_addr["product"]) + "_fpga";
std::string type_name = fpga_type.empty() ? "" : "_" + fpga_type;
std::string image_path;
try {
image_path = find_image_path(base_name + type_name + ".bit");
} catch (const uhd::io_error&) {
image_path = find_image_path(base_name + type_name + ".bin");
}
return image_path;
}
}
}