-
Notifications
You must be signed in to change notification settings - Fork 3k
Config: fix bootloader config errors - propagate errors #12059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5ec7a0b
d7e0012
ee2caf0
00c375b
1c76b7e
b0224ec
2a16200
8d4a166
6ec7534
054e806
eb5ee71
08b2c58
5165275
76af152
e27f456
22ab94a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -894,63 +894,56 @@ def _add_all_regions(self, region_list, active_region_name): | |
def add_regions(self): | ||
"""Add regions to the build profile, if there are any. | ||
""" | ||
|
||
if not getattr(self.target, "bootloader_supported", False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather encode the default behaviour in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is how it is done in regions(). Do you suggest to have target method to return if bootloader is supported and add_regions() would not even be called if not? |
||
return | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the addition for #12007 . The rest was approved already. |
||
|
||
if self.config.has_regions: | ||
try: | ||
regions = list(self.config.regions) | ||
regions.sort(key=lambda x: x.start) | ||
self.notify.info("Using ROM region%s %s in this build." % ( | ||
"s" if len(regions) > 1 else "", | ||
", ".join(r.name for r in regions) | ||
)) | ||
self._add_all_regions(regions, "MBED_APP") | ||
except ConfigException: | ||
pass | ||
regions = list(self.config.regions) | ||
regions.sort(key=lambda x: x.start) | ||
self.notify.info("Using ROM region%s %s in this build." % ( | ||
"s" if len(regions) > 1 else "", | ||
", ".join(r.name for r in regions) | ||
)) | ||
self._add_all_regions(regions, "MBED_APP") | ||
|
||
if self.config.has_ram_regions: | ||
try: | ||
regions = list(self.config.ram_regions) | ||
self.notify.info("Using RAM region%s %s in this build." % ( | ||
"s" if len(regions) > 1 else "", | ||
", ".join(r.name for r in regions) | ||
)) | ||
self._add_all_regions(regions, None) | ||
except ConfigException: | ||
pass | ||
regions = list(self.config.ram_regions) | ||
self.notify.info("Using RAM region%s %s in this build." % ( | ||
"s" if len(regions) > 1 else "", | ||
", ".join(r.name for r in regions) | ||
)) | ||
self._add_all_regions(regions, None) | ||
|
||
Region = namedtuple("Region", "name start size") | ||
|
||
try: | ||
# Add all available ROM regions to build profile | ||
if not getattr(self.target, "static_memory_defines", False): | ||
raise ConfigException() | ||
rom_available_regions = self.config.get_all_active_memories( | ||
ROM_ALL_MEMORIES | ||
|
||
# Add all available ROM regions to build profile | ||
if not getattr(self.target, "static_memory_defines", False): | ||
raise ConfigException() | ||
rom_available_regions = self.config.get_all_active_memories( | ||
ROM_ALL_MEMORIES | ||
) | ||
for key, value in rom_available_regions.items(): | ||
rom_start, rom_size = value | ||
self._add_defines_from_region( | ||
Region("MBED_" + key, rom_start, rom_size), | ||
True, | ||
suffixes=["_START", "_SIZE"] | ||
) | ||
for key, value in rom_available_regions.items(): | ||
rom_start, rom_size = value | ||
self._add_defines_from_region( | ||
Region("MBED_" + key, rom_start, rom_size), | ||
True, | ||
suffixes=["_START", "_SIZE"] | ||
) | ||
except ConfigException: | ||
pass | ||
try: | ||
# Add all available RAM regions to build profile | ||
if not getattr(self.target, "static_memory_defines", False): | ||
raise ConfigException() | ||
ram_available_regions = self.config.get_all_active_memories( | ||
RAM_ALL_MEMORIES | ||
# Add all available RAM regions to build profile | ||
if not getattr(self.target, "static_memory_defines", False): | ||
raise ConfigException() | ||
ram_available_regions = self.config.get_all_active_memories( | ||
RAM_ALL_MEMORIES | ||
) | ||
for key, value in ram_available_regions.items(): | ||
ram_start, ram_size = value | ||
self._add_defines_from_region( | ||
Region("MBED_" + key, ram_start, ram_size), | ||
True, | ||
suffixes=["_START", "_SIZE"] | ||
) | ||
for key, value in ram_available_regions.items(): | ||
ram_start, ram_size = value | ||
self._add_defines_from_region( | ||
Region("MBED_" + key, ram_start, ram_size), | ||
True, | ||
suffixes=["_START", "_SIZE"] | ||
) | ||
except ConfigException: | ||
pass | ||
|
||
STACK_PARAM = "target.boot-stack-size" | ||
TFM_LVL_PARAM = "tfm.level" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
But as I am a copy paste expert... you need to update also stm32f746xg.icf, stm32f767xi.icf, and stm32f769xi.icf...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come they don't fail the build? will check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a copy paste expert!