diff options
author | Michael Auchter <michael.auchter@ni.com> | 2021-06-09 11:34:41 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-06-10 12:01:53 -0500 |
commit | b9816d806d390d21f8e6cc3f81bed94fe913ced1 (patch) | |
tree | 8d981aa74606e20e8637c38cf20fe66ed3119722 /mpm/python | |
parent | 13d26a062429adc17d94f63eed17e9d39bf8a567 (diff) | |
download | uhd-b9816d806d390d21f8e6cc3f81bed94fe913ced1.tar.gz uhd-b9816d806d390d21f8e6cc3f81bed94fe913ced1.tar.bz2 uhd-b9816d806d390d21f8e6cc3f81bed94fe913ced1.zip |
mpm: max10_cpld_flash_ctrl: only reprogram cpld if necessary
When updating the CPLD via the flash method, first read back the CPLD
image from flash and compare it with the image to be programmed. If they
match, the CPLD is already running the correct image and reprogramming
it is not necessary.
Diffstat (limited to 'mpm/python')
-rw-r--r-- | mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py b/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py index c1e756124..7ad61c655 100644 --- a/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py +++ b/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py @@ -203,6 +203,14 @@ class Max10CpldFlashCtrl(): if not self.check_reconfig_engine_status(): return False + self.log.debug('Checking if update is necessary...') + if self.verify_flash_memory(raw_data): + self.log.info('CPLD already programmed with specified image, not reprogramming.') + return True + + if not self.check_reconfig_engine_status(): + return False + self.log.debug('Erasing CPLD flash memory...') if not (self.erase_flash_memory() and self.check_reconfig_engine_status()): |