Skip to content

Commit 22e8265

Browse files
authored
Merge pull request #4483 from c1728p9/workshop_rebase_4061
Improve error messages for bootloader build errors
2 parents cfc4159 + 1ee1556 commit 22e8265

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/config/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,15 @@ def regions(self):
497497
"""Generate a list of regions from the config"""
498498
if not self.target.bootloader_supported:
499499
raise ConfigException("Bootloader not supported on this target.")
500-
cmsis_part = Cache(False, False).index[self.target.device_name]
500+
if not hasattr(self.target, "device_name"):
501+
raise ConfigException("Bootloader not supported on this target: "
502+
"targets.json `device_name` not specified.")
503+
cache = Cache(False, False)
504+
if self.target.device_name not in cache.index:
505+
raise ConfigException("Bootloader not supported on this target: "
506+
"targets.json `device_name` not found in "
507+
"arm_pack_manager index.")
508+
cmsis_part = cache.index[self.target.device_name]
501509
target_overrides = self.app_config_data['target_overrides'].get(
502510
self.target.name, {})
503511
if (('target.bootloader_img' in target_overrides or

0 commit comments

Comments
 (0)