From c2f1f21d415452a6a3a09cd00fc09d0ef1bf7c06 Mon Sep 17 00:00:00 2001 From: michael-west Date: Tue, 24 Sep 2019 17:28:00 -0700 Subject: 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 --- mpm/python/usrp_mpm/periph_manager/base.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mpm') 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, -- cgit v1.2.3