From d62f046e5731ed53db8a8edacbddb53c81fab358 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Wed, 22 Feb 2017 18:27:23 -0600 Subject: [PATCH] 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. --- targets/targets.json | 15 ++++++++++----- tools/config.py | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/targets/targets.json b/targets/targets.json index 23e1003f13..0a06be45ff 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -10,7 +10,8 @@ "features": [], "detect_code": [], "public": false, - "default_lib": "std" + "default_lib": "std", + "bootloader_supported": false }, "Super_Target": { "inherits": ["Target"], @@ -455,7 +456,8 @@ "detect_code": ["0220"], "device_has": ["ANALOGIN", "ANALOGOUT", "ERROR_RED", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SEMIHOST", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"], "release_versions": ["2", "5"], - "device_name": "MKL46Z256xxx4" + "device_name": "MKL46Z256xxx4", + "bootloader_supported": true }, "K20D50M": { "inherits": ["Target"], @@ -581,7 +583,8 @@ "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"], "features": ["LWIP", "STORAGE"], "release_versions": ["2", "5"], - "device_name": "MK64FN1M0xxx12" + "device_name": "MK64FN1M0xxx12", + "bootloader_supported": true }, "MTS_GAMBIT": { "inherits": ["Target"], @@ -889,7 +892,8 @@ "detect_code": ["0796"], "features": ["LWIP"], "release_versions": ["2", "5"], - "device_name" : "STM32F429ZI" + "device_name" : "STM32F429ZI", + "bootloader_supported": true }, "NUCLEO_F439ZI": { "supported_form_factors": ["ARDUINO"], @@ -1327,7 +1331,8 @@ "device_has": ["ANALOGIN", "CAN", "EMAC", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES", "TRNG"], "features": ["LWIP"], "release_versions": ["5"], - "device_name": "STM32F439ZI" + "device_name": "STM32F439ZI", + "bootloader_supported": true }, "NZ32_SC151": { "inherits": ["Target"], diff --git a/tools/config.py b/tools/config.py index 931a695b62..11aa5ecce1 100644 --- a/tools/config.py +++ b/tools/config.py @@ -477,6 +477,8 @@ class Config(object): @property def regions(self): """Generate a list of regions from the config""" + if not self.target.bootloader_supported: + raise ConfigException("Bootloader not supported on this target.") cmsis_part = Cache(False, False).index[self.target.device_name] start = 0 target_overrides = self.app_config_data['target_overrides'].get(