mirror of https://github.com/ARMmbed/mbed-os.git
Correct sector scraping in arm-pack-manager
parent
ccff46d9a3
commit
4045c63f2a
|
@ -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
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue