mirror of https://github.com/ARMmbed/mbed-os.git
Correct sector scraping in arm-pack-manager
parent
35f3332933
commit
c8305a84f4
|
@ -157,10 +157,18 @@ class Cache () :
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
pack = self.pack_from_cache(device)
|
pack = self.pack_from_cache(device)
|
||||||
algo_itr = (pack.open(path) for path in device['algorithm'].keys())
|
ret = []
|
||||||
algo_bin = algo_itr.next()
|
for filename in device['algorithm'].keys():
|
||||||
flm_file = algo_bin.read()
|
try:
|
||||||
return PackFlashAlgo(flm_file).sector_sizes
|
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:
|
except Exception:
|
||||||
return None
|
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:
|
if options.update_packs:
|
||||||
from tools.arm_pack_manager import Cache
|
from tools.arm_pack_manager import Cache
|
||||||
cache = Cache(True, True)
|
cache = Cache(True, True)
|
||||||
cache.cache_descriptors()
|
cache.cache_everything()
|
||||||
|
|
||||||
# Target
|
# Target
|
||||||
if not options.mcu:
|
if not options.mcu:
|
||||||
|
|
Loading…
Reference in New Issue