Skip to content

Commit d7e0012

Browse files
committed
tools: regions only if bootloader is supported
We removed catching and passing, we want to know for any misconfiguration if bootloader is supported. Regions should check if bootloader is supported. In case not, just return. Otherwise we catch any error. This should help us to uncover missing regions or other config error (in case bootloader is enabled via bootloader_supported set to true).
1 parent 5ec7a0b commit d7e0012

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/toolchains/mbed_toolchain.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,10 @@ def _add_all_regions(self, region_list, active_region_name):
894894
def add_regions(self):
895895
"""Add regions to the build profile, if there are any.
896896
"""
897+
898+
if not getattr(self.target, "bootloader_supported", False):
899+
return
900+
897901
if self.config.has_regions:
898902
regions = list(self.config.regions)
899903
regions.sort(key=lambda x: x.start)
@@ -913,6 +917,7 @@ def add_regions(self):
913917

914918
Region = namedtuple("Region", "name start size")
915919

920+
916921
# Add all available ROM regions to build profile
917922
if not getattr(self.target, "static_memory_defines", False):
918923
raise ConfigException()
@@ -926,7 +931,6 @@ def add_regions(self):
926931
True,
927932
suffixes=["_START", "_SIZE"]
928933
)
929-
930934
# Add all available RAM regions to build profile
931935
if not getattr(self.target, "static_memory_defines", False):
932936
raise ConfigException()
@@ -941,7 +945,6 @@ def add_regions(self):
941945
suffixes=["_START", "_SIZE"]
942946
)
943947

944-
945948
STACK_PARAM = "target.boot-stack-size"
946949
TFM_LVL_PARAM = "tfm.level"
947950
XIP_ENABLE_PARAM = "target.xip-enable"

0 commit comments

Comments
 (0)