diff options
author | michael-west <michael.west@ettus.com> | 2019-08-02 11:00:37 -0700 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-08-06 12:06:49 -0700 |
commit | d25614e6ae3504f34afe7f330ce1e0079fa7ab52 (patch) | |
tree | 9fc607e4774d4f45bf5f2a007ae3b1653a399cdb /host/utils | |
parent | 173531521970ed823b2f300180b8cacda94ec841 (diff) | |
download | uhd-d25614e6ae3504f34afe7f330ce1e0079fa7ab52.tar.gz uhd-d25614e6ae3504f34afe7f330ce1e0079fa7ab52.tar.bz2 uhd-d25614e6ae3504f34afe7f330ce1e0079fa7ab52.zip |
B200: Add command to query bootloader status
Updated b2xx_fx3_utils to add a --query_bootloader option to check if
the bootloader is loaded or not.
Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/b2xx_fx3_utils.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index c94badc9d..e495262be 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -334,7 +334,8 @@ int32_t main(int32_t argc, char* argv[]) "load-fpga,L", po::value<std::string>(&fpga_file), "Load a FPGA (bin) file into the FPGA.")( "load-bootloader,B", po::value<std::string>(&bl_file), - "Load a bootloader (img) file into the EEPROM"); + "Load a bootloader (img) file into the EEPROM")( + "query-bootloader,Q", "Check if bootloader is loaded."); // Hidden options provided for testing - use at your own risk! po::options_description hidden("Hidden options"); @@ -666,6 +667,13 @@ int32_t main(int32_t argc, char* argv[]) std::cerr << "Exception while resetting FX3: " << e.what() << std::endl; return EXIT_FAILURE; } + } else if (vm.count("query-bootloader")) { + auto signature = b200->read_eeprom(0x0, 0x0, 4); + if (signature != NEW_EEPROM_SIGNATURE) { + std::cout << "No bootloader found on device" << std::endl; + return EXIT_FAILURE; + } + std::cout << "Bootloader is present" << std::endl; } std::cout << "Operation complete! I did it! I did it!" << std::endl; |