Merge pull request #4483 from c1728p9/workshop_rebase_4061

Improve error messages for bootloader build errors
pull/4521/merge
Sam Grove 2017-06-11 01:09:35 -05:00 committed by GitHub
commit 22e82659d1
1 changed files with 9 additions and 1 deletions

View File

@ -497,7 +497,15 @@ class Config(object):
"""Generate a list of regions from the config"""
if not self.target.bootloader_supported:
raise ConfigException("Bootloader not supported on this target.")
cmsis_part = Cache(False, False).index[self.target.device_name]
if not hasattr(self.target, "device_name"):
raise ConfigException("Bootloader not supported on this target: "
"targets.json `device_name` not specified.")
cache = Cache(False, False)
if self.target.device_name not in cache.index:
raise ConfigException("Bootloader not supported on this target: "
"targets.json `device_name` not found in "
"arm_pack_manager index.")
cmsis_part = cache.index[self.target.device_name]
target_overrides = self.app_config_data['target_overrides'].get(
self.target.name, {})
if (('target.bootloader_img' in target_overrides or