Correct sector scraping in arm-pack-manager

pull/6123/head
Jimmy Brisson 2018-02-16 11:20:27 -06:00
parent ccff46d9a3
commit 4045c63f2a
4 changed files with 15 additions and 7 deletions

View File

@ -163,10 +163,18 @@ class Cache () :
"""
try:
pack = self.pack_from_cache(device)
algo_itr = (pack.open(path) for path in device['algorithm'].keys())
algo_bin = algo_itr.next()
flm_file = algo_bin.read()
return PackFlashAlgo(flm_file).sector_sizes
ret = []
for filename in device['algorithm'].keys():
try:
flm = pack.open(filename)
flash_alg = PackFlashAlgo(flm.read())
sectors = [(flash_alg.flash_start + offset, size)
for offset, size in flash_alg.sector_sizes]
ret.extend(sectors)
except Exception:
pass
ret.sort(key=lambda sector: sector[0])
return ret
except Exception:
return None

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -221,7 +221,7 @@ def main():
if options.update_packs:
from tools.arm_pack_manager import Cache
cache = Cache(True, True)
cache.cache_descriptors()
cache.cache_everything()
# Target
if not options.mcu: