Correct sector scraping in arm-pack-manager

pull/6201/head
Jimmy Brisson 2018-02-16 11:20:27 -06:00 committed by Cruz Monrreal II
parent 35f3332933
commit c8305a84f4
4 changed files with 15 additions and 7 deletions

View File

@ -157,10 +157,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: