aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2019-09-24 17:28:00 -0700
committerMartin Braun <martin.braun@ettus.com>2019-10-15 15:21:52 -0700
commitc2f1f21d415452a6a3a09cd00fc09d0ef1bf7c06 (patch)
tree954995425c4e37b6d524a1c881219bc2d44769f8
parent2ec46dbb04733e7739c550e61b7d954f9ffb8c93 (diff)
downloaduhd-c2f1f21d415452a6a3a09cd00fc09d0ef1bf7c06.tar.gz
uhd-c2f1f21d415452a6a3a09cd00fc09d0ef1bf7c06.tar.bz2
uhd-c2f1f21d415452a6a3a09cd00fc09d0ef1bf7c06.zip
MPM: Add check for valid EEPROM address
Provides a more useful error message if the EEPROM cannot be found at the specified address. Without this change a generic index out of range error is raised. Signed-off-by: michael-west <michael.west@ettus.com>
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index fd4602151..be7600333 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -244,6 +244,9 @@ class PeriphManagerBase(object):
if len(self.mboard_eeprom_addr):
self.log.trace("Reading EEPROM from address `{}'..."
.format(self.mboard_eeprom_addr))
+ if (not get_eeprom_paths(self.mboard_eeprom_addr)):
+ raise RuntimeError("No EEPROM found at address `{}'"
+ .format(self.mboard_eeprom_addr))
(eeprom_head, eeprom_rawdata) = eeprom.read_eeprom(
get_eeprom_paths(self.mboard_eeprom_addr)[0],
self.mboard_eeprom_offset,