Skip to content

Commit d62f046

Browse files
committed
Fail bootloader builds on targets that don't support it
This patch will prevent building bootloader builds on targets that have not yet had their linker scripts/scatter files changed to allow for the ROM space shrinking expected by bootloader builds. At the point of this patch, bootloader linker script modifications are only supported by the NUCLEO_F429ZI, K64F, KL46Z, and Odin.
1 parent 9a63bfb commit d62f046

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

targets/targets.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"features": [],
1111
"detect_code": [],
1212
"public": false,
13-
"default_lib": "std"
13+
"default_lib": "std",
14+
"bootloader_supported": false
1415
},
1516
"Super_Target": {
1617
"inherits": ["Target"],
@@ -455,7 +456,8 @@
455456
"detect_code": ["0220"],
456457
"device_has": ["ANALOGIN", "ANALOGOUT", "ERROR_RED", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SEMIHOST", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
457458
"release_versions": ["2", "5"],
458-
"device_name": "MKL46Z256xxx4"
459+
"device_name": "MKL46Z256xxx4",
460+
"bootloader_supported": true
459461
},
460462
"K20D50M": {
461463
"inherits": ["Target"],
@@ -581,7 +583,8 @@
581583
"device_has": ["ANALOGIN", "ANALOGOUT", "ERROR_RED", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE", "STDIO_MESSAGES", "STORAGE", "TRNG"],
582584
"features": ["LWIP", "STORAGE"],
583585
"release_versions": ["2", "5"],
584-
"device_name": "MK64FN1M0xxx12"
586+
"device_name": "MK64FN1M0xxx12",
587+
"bootloader_supported": true
585588
},
586589
"MTS_GAMBIT": {
587590
"inherits": ["Target"],
@@ -889,7 +892,8 @@
889892
"detect_code": ["0796"],
890893
"features": ["LWIP"],
891894
"release_versions": ["2", "5"],
892-
"device_name" : "STM32F429ZI"
895+
"device_name" : "STM32F429ZI",
896+
"bootloader_supported": true
893897
},
894898
"NUCLEO_F439ZI": {
895899
"supported_form_factors": ["ARDUINO"],
@@ -1327,7 +1331,8 @@
13271331
"device_has": ["ANALOGIN", "CAN", "EMAC", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES", "TRNG"],
13281332
"features": ["LWIP"],
13291333
"release_versions": ["5"],
1330-
"device_name": "STM32F439ZI"
1334+
"device_name": "STM32F439ZI",
1335+
"bootloader_supported": true
13311336
},
13321337
"NZ32_SC151": {
13331338
"inherits": ["Target"],

tools/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ def has_regions(self):
477477
@property
478478
def regions(self):
479479
"""Generate a list of regions from the config"""
480+
if not self.target.bootloader_supported:
481+
raise ConfigException("Bootloader not supported on this target.")
480482
cmsis_part = Cache(False, False).index[self.target.device_name]
481483
start = 0
482484
target_overrides = self.app_config_data['target_overrides'].get(

0 commit comments

Comments
 (0)