Skip to content

Commit f5859b3

Browse files
committed
Disable Cortex-A in tooling to provide better error messages
Disable Cortex-A in compile supported matrix Disable Cortex-A in export supported matrix
1 parent a3f7d06 commit f5859b3

File tree

7 files changed

+25
-3
lines changed

7 files changed

+25
-3
lines changed

tools/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
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
3536
from tools.build_api import build_library, build_mbed_libs, build_lib
3637
from tools.build_api import mcu_toolchain_matrix
3738
from tools.build_api import print_build_results
@@ -135,6 +136,7 @@
135136

136137
# Get target list
137138
targets = options.mcu if options.mcu else TARGET_NAMES
139+
assert [mcu_is_enabled(parser, mcu) for mcu in targets]
138140

139141
# Get toolchains list
140142
toolchains = options.tool if options.tool else TOOLCHAINS

tools/build_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,9 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
12441244
# FIlter out platforms using regex
12451245
if re.search(platform_filter, target) is None:
12461246
continue
1247+
# TODO: Remove this check when Cortex-A is re-enabled
1248+
if "Cortex-A" in TARGET_MAP[target].core:
1249+
continue
12471250
target_counter += 1
12481251

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

tools/export/__init__.py

Lines changed: 3 additions & 1 deletion
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
36+
from tools.targets import TARGET_NAMES, TARGET_MAP
3737

3838
EXPORTERS = {
3939
'uvision5': uvision.Uvision,
@@ -100,6 +100,8 @@ 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
103105
row = [target] # First column is platform name
104106
for ide in supported_ides:
105107
text = "-"

tools/make.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
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
4546
from tools.build_api import build_project
4647
from tools.build_api import mcu_toolchain_matrix
4748
from tools.build_api import mcu_toolchain_list
@@ -201,6 +202,7 @@
201202
if options.mcu is None :
202203
args_error(parser, "argument -m/--mcu is required")
203204
mcu = options.mcu[0]
205+
assert mcu_is_enabled(parser, mcu)
204206

205207
# Toolchain
206208
if options.tool is None:

tools/options.py

Lines changed: 11 additions & 1 deletion
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
22+
from tools.targets import TARGET_NAMES, TARGET_MAP
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,3 +121,13 @@ 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: 2 additions & 1 deletion
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
23+
from tools.options import extract_profile, list_profiles, mcu_is_enabled
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,6 +221,7 @@ 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)
224225
# Toolchain
225226
if not options.ide:
226227
args_error(parser, "argument -i is required")

tools/test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
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
4243

4344
if __name__ == '__main__':
4445
try:
@@ -115,6 +116,7 @@
115116
if options.mcu is None :
116117
args_error(parser, "argument -m/--mcu is required")
117118
mcu = options.mcu[0]
119+
assert mcu_is_enabled(parser, mcu)
118120

119121
# Toolchain
120122
if options.tool is None:

0 commit comments

Comments
 (0)