Skip to content

Commit 0c227a0

Browse files
authored
Merge pull request #12059 from 0xc0170/JammuKekkonen-remove_hiding_config_errors
Config: fix bootloader config errors - propagate errors
2 parents 76ae27e + 22ab94a commit 0c227a0

File tree

6 files changed

+59
-70
lines changed

6 files changed

+59
-70
lines changed

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/TOOLCHAIN_IAR/stm32f746xg.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ITCM-RAM: 16K (0x3FFF) @0x00000000
2626
if (!isdefinedsymbol(MBED_ROM_START)) { define symbol MBED_ROM_START = 0x8000000; }
2727
if (!isdefinedsymbol(MBED_ROM_SIZE)) { define symbol MBED_ROM_SIZE = 0x200000; }
2828
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_START = 0x20010000; }
29-
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_SIZE = 0x40000; }
29+
if (!isdefinedsymbol(MBED_RAM_SIZE)) { define symbol MBED_RAM_SIZE = 0x40000; }
3030
if (!isdefinedsymbol(MBED_RAM1_START)) { define symbol MBED_RAM1_START = 0x20000000; }
3131
if (!isdefinedsymbol(MBED_RAM1_SIZE)) { define symbol MBED_RAM1_SIZE = 0x10000; }
3232

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F756xG/device/TOOLCHAIN_IAR/stm32f756xg.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ITCM-RAM: 16K (0x3FFF) @0x00000000
2626
if (!isdefinedsymbol(MBED_ROM_START)) { define symbol MBED_ROM_START = 0x8000000; }
2727
if (!isdefinedsymbol(MBED_ROM_SIZE)) { define symbol MBED_ROM_SIZE = 0x200000; }
2828
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_START = 0x20010000; }
29-
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_SIZE = 0x40000; }
29+
if (!isdefinedsymbol(MBED_RAM_SIZE)) { define symbol MBED_RAM_SIZE = 0x40000; }
3030
if (!isdefinedsymbol(MBED_RAM1_START)) { define symbol MBED_RAM1_START = 0x20000000; }
3131
if (!isdefinedsymbol(MBED_RAM1_SIZE)) { define symbol MBED_RAM1_SIZE = 0x10000; }
3232

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F767xI/device/TOOLCHAIN_IAR/stm32f767xi.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ITCM-RAM: 16K (0x3FFF) @0x00000000
2626
if (!isdefinedsymbol(MBED_ROM_START)) { define symbol MBED_ROM_START = 0x8000000; }
2727
if (!isdefinedsymbol(MBED_ROM_SIZE)) { define symbol MBED_ROM_SIZE = 0x200000; }
2828
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_START = 0x20020000; }
29-
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_SIZE = 0x60000; }
29+
if (!isdefinedsymbol(MBED_RAM_SIZE)) { define symbol MBED_RAM_SIZE = 0x60000; }
3030
if (!isdefinedsymbol(MBED_RAM1_START)) { define symbol MBED_RAM1_START = 0x20000000; }
3131
if (!isdefinedsymbol(MBED_RAM1_SIZE)) { define symbol MBED_RAM1_SIZE = 0x20000; }
3232

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/device/TOOLCHAIN_IAR/stm32f769xi.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ITCM-RAM: 16K (0x3FFF) @0x00000000
2626
if (!isdefinedsymbol(MBED_ROM_START)) { define symbol MBED_ROM_START = 0x8000000; }
2727
if (!isdefinedsymbol(MBED_ROM_SIZE)) { define symbol MBED_ROM_SIZE = 0x200000; }
2828
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_START = 0x20020000; }
29-
if (!isdefinedsymbol(MBED_RAM_START)) { define symbol MBED_RAM_SIZE = 0x60000; }
29+
if (!isdefinedsymbol(MBED_RAM_SIZE)) { define symbol MBED_RAM_SIZE = 0x60000; }
3030
if (!isdefinedsymbol(MBED_RAM1_START)) { define symbol MBED_RAM1_START = 0x20000000; }
3131
if (!isdefinedsymbol(MBED_RAM1_SIZE)) { define symbol MBED_RAM1_SIZE = 0x20000; }
3232

targets/targets.json

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5878,7 +5878,7 @@
58785878
"device_has_add": ["USBDEVICE", "EMAC", "FLASH", "LPTICKER"],
58795879
"release_versions": ["2", "5"],
58805880
"device_name": "R7S72100",
5881-
"bootloader_supported": true
5881+
"bootloader_supported": false
58825882
},
58835883
"VK_RZ_A1H": {
58845884
"inherits": ["RZ_A1XX"],
@@ -5895,7 +5895,7 @@
58955895
"device_has_remove": ["ETHERNET"],
58965896
"release_versions": ["2", "5"],
58975897
"device_name": "R7S72103",
5898-
"bootloader_supported": true,
5898+
"bootloader_supported": false,
58995899
"overrides": {
59005900
"network-default-interface-type": null
59015901
}
@@ -6753,7 +6753,8 @@
67536753
},
67546754
"overrides": {
67556755
"network-default-interface-type": "MESH"
6756-
}
6756+
},
6757+
"bootloader_supported": false
67576758
},
67586759
"EFM32PG12B500F1024GL125": {
67596760
"inherits": ["EFM32"],
@@ -8475,7 +8476,7 @@
84758476
"MPU"
84768477
],
84778478
"release_versions": ["2", "5"],
8478-
"bootloader_supported": true
8479+
"bootloader_supported": false
84798480
},
84808481
"NUCLEO_WB55RG": {
84818482
"inherits": ["FAMILY_STM32"],
@@ -8509,7 +8510,7 @@
85098510
],
85108511
"features": ["BLE"],
85118512
"release_versions": ["2", "5"],
8512-
"bootloader_supported": true
8513+
"bootloader_supported": false
85138514
},
85148515
"VBLUNO52": {
85158516
"supported_form_factors": ["ARDUINO"],
@@ -9184,7 +9185,7 @@
91849185
"post_binary_hook": {
91859186
"function": "PSOC6Code.complete"
91869187
},
9187-
"bootloader_supported": true,
9188+
"bootloader_supported": false,
91889189
"sectors": [[268435456, 512]],
91899190
"overrides": {
91909191
"network-default-interface-type": "WIFI"
@@ -9197,7 +9198,7 @@
91979198
"post_binary_hook": {
91989199
"function": "PSOC6Code.complete"
91999200
},
9200-
"bootloader_supported": true,
9201+
"bootloader_supported": false,
92019202
"sectors": [[268435456, 512]]
92029203
},
92039204
"CY8CPROTO_062S3_4343W": {
@@ -9229,7 +9230,7 @@
92299230
"function": "PSOC6Code.complete"
92309231
},
92319232
"sectors": [[268443648, 512]],
9232-
"bootloader_supported": true
9233+
"bootloader_supported": false
92339234
},
92349235
"CY8CPROTO_063_BLE": {
92359236
"inherits": ["MCU_PSOC6_M4"],
@@ -9245,7 +9246,7 @@
92459246
"function": "PSOC6Code.complete"
92469247
},
92479248
"sectors": [[268443648, 512]],
9248-
"bootloader_supported": true
9249+
"bootloader_supported": false
92499250
},
92509251
"CY8CPROTO_064_SB": {
92519252
"inherits": ["MCU_PSOC6_M4"],
@@ -9279,7 +9280,7 @@
92799280
"post_binary_hook": {
92809281
"function": "PSOC6Code.complete"
92819282
},
9282-
"bootloader_supported": true,
9283+
"bootloader_supported": false,
92839284
"sectors": [[268435456, 512]],
92849285
"overrides": {
92859286
"network-default-interface-type": "WIFI"
@@ -9461,15 +9462,10 @@
94619462
"inherits": ["RDA5981X"],
94629463
"detect_code": ["8001"],
94639464
"components_add": ["FLASHIAP"],
9464-
"bootloader_supported": true,
9465-
"mbed_ram_start": "0x00100080",
9466-
"mbed_ram_size": "0x1ff80",
9467-
"mbed_rom_start": "0x18001000",
9468-
"mbed_rom_size": "0x1F4000",
9469-
"sectors": [[0,4096]],
94709465
"overrides": {
94719466
"network-default-interface-type" : "WIFI"
9472-
}
9467+
},
9468+
"bootloader_supported": false
94739469
},
94749470
"GD32_Target": {
94759471
"inherits": ["Target"],

tools/toolchains/mbed_toolchain.py

Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -894,63 +894,56 @@ 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:
898-
try:
899-
regions = list(self.config.regions)
900-
regions.sort(key=lambda x: x.start)
901-
self.notify.info("Using ROM region%s %s in this build." % (
902-
"s" if len(regions) > 1 else "",
903-
", ".join(r.name for r in regions)
904-
))
905-
self._add_all_regions(regions, "MBED_APP")
906-
except ConfigException:
907-
pass
902+
regions = list(self.config.regions)
903+
regions.sort(key=lambda x: x.start)
904+
self.notify.info("Using ROM region%s %s in this build." % (
905+
"s" if len(regions) > 1 else "",
906+
", ".join(r.name for r in regions)
907+
))
908+
self._add_all_regions(regions, "MBED_APP")
908909

909910
if self.config.has_ram_regions:
910-
try:
911-
regions = list(self.config.ram_regions)
912-
self.notify.info("Using RAM region%s %s in this build." % (
913-
"s" if len(regions) > 1 else "",
914-
", ".join(r.name for r in regions)
915-
))
916-
self._add_all_regions(regions, None)
917-
except ConfigException:
918-
pass
911+
regions = list(self.config.ram_regions)
912+
self.notify.info("Using RAM region%s %s in this build." % (
913+
"s" if len(regions) > 1 else "",
914+
", ".join(r.name for r in regions)
915+
))
916+
self._add_all_regions(regions, None)
919917

920918
Region = namedtuple("Region", "name start size")
921919

922-
try:
923-
# Add all available ROM regions to build profile
924-
if not getattr(self.target, "static_memory_defines", False):
925-
raise ConfigException()
926-
rom_available_regions = self.config.get_all_active_memories(
927-
ROM_ALL_MEMORIES
920+
921+
# Add all available ROM regions to build profile
922+
if not getattr(self.target, "static_memory_defines", False):
923+
raise ConfigException()
924+
rom_available_regions = self.config.get_all_active_memories(
925+
ROM_ALL_MEMORIES
926+
)
927+
for key, value in rom_available_regions.items():
928+
rom_start, rom_size = value
929+
self._add_defines_from_region(
930+
Region("MBED_" + key, rom_start, rom_size),
931+
True,
932+
suffixes=["_START", "_SIZE"]
928933
)
929-
for key, value in rom_available_regions.items():
930-
rom_start, rom_size = value
931-
self._add_defines_from_region(
932-
Region("MBED_" + key, rom_start, rom_size),
933-
True,
934-
suffixes=["_START", "_SIZE"]
935-
)
936-
except ConfigException:
937-
pass
938-
try:
939-
# Add all available RAM regions to build profile
940-
if not getattr(self.target, "static_memory_defines", False):
941-
raise ConfigException()
942-
ram_available_regions = self.config.get_all_active_memories(
943-
RAM_ALL_MEMORIES
934+
# Add all available RAM regions to build profile
935+
if not getattr(self.target, "static_memory_defines", False):
936+
raise ConfigException()
937+
ram_available_regions = self.config.get_all_active_memories(
938+
RAM_ALL_MEMORIES
939+
)
940+
for key, value in ram_available_regions.items():
941+
ram_start, ram_size = value
942+
self._add_defines_from_region(
943+
Region("MBED_" + key, ram_start, ram_size),
944+
True,
945+
suffixes=["_START", "_SIZE"]
944946
)
945-
for key, value in ram_available_regions.items():
946-
ram_start, ram_size = value
947-
self._add_defines_from_region(
948-
Region("MBED_" + key, ram_start, ram_size),
949-
True,
950-
suffixes=["_START", "_SIZE"]
951-
)
952-
except ConfigException:
953-
pass
954947

955948
STACK_PARAM = "target.boot-stack-size"
956949
TFM_LVL_PARAM = "tfm.level"

0 commit comments

Comments
 (0)