Skip to content

Commit 4c4fb82

Browse files
authored
Merge pull request #4415 from theotherjimmy/disable-2-builds
Disallow building of mbed OS 2 + RTOS, and remove mbed OS 5 support for Cortext-A
2 parents fa0cd20 + cee0cbd commit 4c4fb82

File tree

9 files changed

+20
-33
lines changed

9 files changed

+20
-33
lines changed

targets/targets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@
19501950
"inherits": ["Target"],
19511951
"device_has": ["ANALOGIN", "CAN", "ERROR_PATTERN", "ETHERNET", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"],
19521952
"features": ["LWIP"],
1953-
"release_versions": ["2", "5"]
1953+
"release_versions": ["2"]
19541954
},
19551955
"VK_RZ_A1H": {
19561956
"inherits": ["Target"],
@@ -1962,7 +1962,7 @@
19621962
"device_has": ["ANALOGIN", "CAN", "ERROR_PATTERN", "ETHERNET", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
19631963
"features": ["LWIP"],
19641964
"default_lib": "std",
1965-
"release_versions": ["2", "5"]
1965+
"release_versions": ["2"]
19661966
},
19671967
"MAXWSNENV": {
19681968
"inherits": ["Target"],

tools/build.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
from tools.targets import TARGET_NAMES, TARGET_MAP
3333
from tools.options import get_default_options_parser
3434
from tools.options import extract_profile
35-
from tools.options import mcu_is_enabled
3635
from tools.build_api import build_library, build_mbed_libs, build_lib
3736
from tools.build_api import mcu_toolchain_matrix
3837
from tools.build_api import print_build_results
@@ -136,7 +135,6 @@
136135

137136
# Get target list
138137
targets = options.mcu if options.mcu else TARGET_NAMES
139-
assert [mcu_is_enabled(parser, mcu) for mcu in targets]
140138

141139
# Get toolchains list
142140
toolchains = options.tool if options.tool else TOOLCHAINS

tools/build_api.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,10 @@ def build_project(src_paths, build_path, target, toolchain_name,
478478
src_paths.extend(libraries_paths)
479479
inc_dirs.extend(map(dirname, libraries_paths))
480480

481-
# Build Directory
482481
if clean and exists(build_path):
483482
rmtree(build_path)
484483
mkdir(build_path)
485484

486-
# Pass all params to the unified prepare_toolchain()
487485
toolchain = prepare_toolchain(
488486
src_paths, build_path, target, toolchain_name, macros=macros,
489487
clean=clean, jobs=jobs, notify=notify, silent=silent, verbose=verbose,
@@ -513,6 +511,17 @@ def build_project(src_paths, build_path, target, toolchain_name,
513511
try:
514512
# Call unified scan_resources
515513
resources = scan_resources(src_paths, toolchain, inc_dirs=inc_dirs)
514+
if (hasattr(toolchain.target, "release_versions") and
515+
"5" not in toolchain.target.release_versions and
516+
"rtos" in toolchain.config.lib_config_data):
517+
if "Cortex-A" in toolchain.target.core:
518+
raise NotSupportedException(
519+
("%s Will be supported in mbed OS 5.6. "
520+
"To use the %s, please checkout the mbed OS 5.4 release branch. "
521+
"See https://developer.mbed.org/platforms/Renesas-GR-PEACH/#important-notice "
522+
"for more information") % (toolchain.target.name, toolchain.target.name))
523+
else:
524+
raise NotSupportedException("Target does not support mbed OS 5")
516525

517526
# Change linker script if specified
518527
if linker_script is not None:
@@ -1244,9 +1253,6 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
12441253
# FIlter out platforms using regex
12451254
if re.search(platform_filter, target) is None:
12461255
continue
1247-
# TODO: Remove this check when Cortex-A is re-enabled
1248-
if "Cortex-A" in TARGET_MAP[target].core:
1249-
continue
12501256
target_counter += 1
12511257

12521258
row = [target] # First column is platform name

tools/export/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt, vscode
3434
from tools.export import gnuarmeclipse
3535
from tools.export import qtcreator
36-
from tools.targets import TARGET_NAMES, TARGET_MAP
36+
from tools.targets import TARGET_NAMES
3737

3838
EXPORTERS = {
3939
'uvision5': uvision.Uvision,
@@ -100,8 +100,6 @@ def mcu_ide_matrix(verbose_html=False):
100100

101101
perm_counter = 0
102102
for target in sorted(TARGET_NAMES):
103-
if "Cortex-A" in TARGET_MAP[target].core:
104-
continue
105103
row = [target] # First column is platform name
106104
for ide in supported_ides:
107105
text = "-"

tools/make.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from tools.targets import TARGET_MAP
4343
from tools.options import get_default_options_parser
4444
from tools.options import extract_profile
45-
from tools.options import mcu_is_enabled
4645
from tools.build_api import build_project
4746
from tools.build_api import mcu_toolchain_matrix
4847
from tools.build_api import mcu_toolchain_list
@@ -202,7 +201,6 @@
202201
if options.mcu is None :
203202
args_error(parser, "argument -m/--mcu is required")
204203
mcu = options.mcu[0]
205-
assert mcu_is_enabled(parser, mcu)
206204

207205
# Toolchain
208206
if options.tool is None:
@@ -315,8 +313,8 @@
315313

316314
except KeyboardInterrupt, e:
317315
print "\n[CTRL+c] exit"
318-
except NotSupportedException, e:
319-
print "\nNot supported for selected target"
316+
except NotSupportedException as e:
317+
print "\nCould not compile for %s: %s" % (mcu, str(e))
320318
except Exception,e:
321319
if options.verbose:
322320
import traceback

tools/options.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from os import listdir
2020
from argparse import ArgumentParser
2121
from tools.toolchains import TOOLCHAINS
22-
from tools.targets import TARGET_NAMES, TARGET_MAP
22+
from tools.targets import TARGET_NAMES
2323
from tools.utils import argparse_force_uppercase_type, \
2424
argparse_lowercase_hyphen_type, argparse_many, \
2525
argparse_filestring_type, args_error, argparse_profile_filestring_type,\
@@ -121,13 +121,3 @@ def extract_profile(parser, options, toolchain, fallback="develop"):
121121
" supported by profile {}").format(toolchain,
122122
filename))
123123
return profile
124-
125-
def mcu_is_enabled(parser, mcu):
126-
if "Cortex-A" in TARGET_MAP[mcu].core:
127-
args_error(
128-
parser,
129-
("%s Will be supported in mbed OS 5.6. "
130-
"To use the %s, please checkout the mbed OS 5.4 release branch. "
131-
"See https://developer.mbed.org/platforms/Renesas-GR-PEACH/#important-notice "
132-
"for more information") % (mcu, mcu))
133-
return True

tools/project.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from tools.utils import argparse_force_lowercase_type
2121
from tools.utils import argparse_force_uppercase_type
2222
from tools.utils import print_large_string
23-
from tools.options import extract_profile, list_profiles, mcu_is_enabled
23+
from tools.options import extract_profile, list_profiles
2424

2525
def setup_project(ide, target, program=None, source_dir=None, build=None, export_path=None):
2626
"""Generate a name, if not provided, and find dependencies
@@ -221,7 +221,6 @@ def main():
221221
if not options.mcu:
222222
args_error(parser, "argument -m/--mcu is required")
223223

224-
assert mcu_is_enabled(parser, options.mcu)
225224
# Toolchain
226225
if not options.ide:
227226
args_error(parser, "argument -i is required")

tools/test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
from utils import argparse_dir_not_parent
4040
from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS, TOOLCHAIN_CLASSES
4141
from tools.settings import CLI_COLOR_MAP
42-
from tools.options import mcu_is_enabled
4342

4443
if __name__ == '__main__':
4544
try:
@@ -116,7 +115,6 @@
116115
if options.mcu is None :
117116
args_error(parser, "argument -m/--mcu is required")
118117
mcu = options.mcu[0]
119-
assert mcu_is_enabled(parser, mcu)
120118

121119
# Toolchain
122120
if options.tool is None:

tools/test/build_api/build_api_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_build_project_app_config(self, mock_prepare_toolchain, mock_exists, _,
131131
mock_exists.return_value = False
132132
mock_prepare_toolchain().link_program.return_value = 1, 2
133133
mock_prepare_toolchain().config = namedtuple(
134-
"Config", "has_regions name")(None, None)
134+
"Config", "has_regions name lib_config_data")(None, None, {})
135135

136136
build_project(self.src_paths, self.build_path, self.target,
137137
self.toolchain_name, app_config=app_config)
@@ -160,7 +160,7 @@ def test_build_project_no_app_config(self, mock_prepare_toolchain, mock_exists,
160160
# Needed for the unpacking of the returned value
161161
mock_prepare_toolchain().link_program.return_value = 1, 2
162162
mock_prepare_toolchain().config = namedtuple(
163-
"Config", "has_regions name")(None, None)
163+
"Config", "has_regions name lib_config_data")(None, None, {})
164164

165165
build_project(self.src_paths, self.build_path, self.target,
166166
self.toolchain_name)

0 commit comments

Comments
 (0)