Skip to content

Commit 88c398b

Browse files
authored
Merge pull request #4377 from theotherjimmy/disable-cortex-A
Disable Cortex-A in tooling for better error messages
2 parents f438251 + f5859b3 commit 88c398b

File tree

8 files changed

+48
-3
lines changed

8 files changed

+48
-3
lines changed

targets/targets.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,6 +1917,29 @@
19171917
"features": ["BLE"],
19181918
"release_versions": ["2", "5"]
19191919
},
1920+
"RZ_A1H": {
1921+
"supported_form_factors": ["ARDUINO"],
1922+
"core": "Cortex-A9",
1923+
"program_cycle_s": 2,
1924+
"extra_labels": ["RENESAS", "MBRZA1H"],
1925+
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"],
1926+
"inherits": ["Target"],
1927+
"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"],
1928+
"features": ["LWIP"],
1929+
"release_versions": ["2", "5"]
1930+
},
1931+
"VK_RZ_A1H": {
1932+
"inherits": ["Target"],
1933+
"core": "Cortex-A9",
1934+
"extra_labels": ["RENESAS", "VKRZA1H"],
1935+
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"],
1936+
"default_toolchain": "ARM",
1937+
"program_cycle_s": 2,
1938+
"device_has": ["ANALOGIN", "CAN", "ERROR_PATTERN", "ETHERNET", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
1939+
"features": ["LWIP"],
1940+
"default_lib": "std",
1941+
"release_versions": ["2", "5"]
1942+
},
19201943
"MAXWSNENV": {
19211944
"inherits": ["Target"],
19221945
"core": "Cortex-M3",

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)