From 2618b51cb80a0c13e4a005bafc7255b8e70ccb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Hofrichter?= Date: Mon, 13 Jul 2026 13:33:25 +0200 Subject: [PATCH] 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 --- host/lib/usrp/mpmd/mpmd_image_loader.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/host/lib/usrp/mpmd/mpmd_image_loader.cpp b/host/lib/usrp/mpmd/mpmd_image_loader.cpp index 1875d2d7e..3dd50b3af 100644 --- a/host/lib/usrp/mpmd/mpmd_image_loader.cpp +++ b/host/lib/usrp/mpmd/mpmd_image_loader.cpp @@ -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; } } }