Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
BUILD_DIR)
from .resources import Resources, FileType, FileRef
from .notifier.mock import MockNotifier
from .targets import TARGET_NAMES, TARGET_MAP
from .targets import TARGET_NAMES, TARGET_MAP, CORE_ARCH
from .libraries import Library
from .toolchains import TOOLCHAIN_CLASSES
from .config import Config
Expand Down Expand Up @@ -316,6 +316,8 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
raise NotSupportedException(
"Target {} is not supported by toolchain {}".format(
target.name, toolchain_name))
if (toolchain_name == "ARM" and CORE_ARCH[target.core] == 8):
toolchain_name = "ARMC6"

try:
cur_tc = TOOLCHAIN_CLASSES[toolchain_name]
Expand Down Expand Up @@ -1196,9 +1198,13 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
row.append(text)

for unique_toolchain in unique_supported_toolchains:
if (unique_toolchain in TARGET_MAP[target].supported_toolchains or
tgt_obj = TARGET_MAP[target]
if (unique_toolchain in tgt_obj.supported_toolchains or
(unique_toolchain == "ARMC6" and
"ARM" in TARGET_MAP[target].supported_toolchains)):
"ARM" in tgt_obj.supported_toolchains) or
(unique_toolchain == "ARM" and
"ARMC6" in tgt_obj.supported_toolchains and
CORE_ARCH[tgt_obj.core] == 8)):
text = "Supported"
perm_counter += 1
else:
Expand Down
19 changes: 18 additions & 1 deletion tools/targets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from tools.utils import json_file_to_dict

__all__ = ["target", "TARGETS", "TARGET_MAP", "TARGET_NAMES", "CORE_LABELS",
"HookError", "generate_py_target", "Target",
"CORE_ARCH", "HookError", "generate_py_target", "Target",
"CUMULATIVE_ATTRIBUTES", "get_resolution_order"]

CORE_LABELS = {
Expand All @@ -50,6 +50,23 @@
"Cortex-M33-NS": ["M33", "M33_NS", "CORTEX_M", "LIKE_CORTEX_M33", "CORTEX"]
}

CORE_ARCH = {
"Cortex-M0": 6,
"Cortex-M0+": 6,
"Cortex-M1": 6,
"Cortex-M3": 7,
"Cortex-M4": 7,
"Cortex-M4F": 7,
"Cortex-M7": 7,
"Cortex-M7F": 7,
"Cortex-M7FD": 7,
"Cortex-A9": 7,
"Cortex-M23": 8,
"Cortex-M23-NS": 8,
"Cortex-M33": 8,
"Cortex-M33-NS": 8,
}

################################################################################
# Generic Target class that reads and interprets the data in targets.json

Expand Down
2 changes: 1 addition & 1 deletion tools/test/toolchains/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def test_toolchain_profile_asm(profile, source_file):
with patch('os.mkdir') as _mkdir:
for _, tc_class in TOOLCHAIN_CLASSES.items():
toolchain = tc_class(TARGET_MAP["K64F"], build_profile=profile,
notify=MockNotifier)
notify=MockNotifier())
toolchain.inc_md5 = ""
toolchain.build_dir = ""
for parameter in profile['asm']:
Expand Down
9 changes: 9 additions & 0 deletions tools/toolchains/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from shutil import rmtree
from distutils.version import LooseVersion

from tools.targets import CORE_ARCH
from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS
from tools.hooks import hook_tool
from tools.utils import mkdir, NotSupportedException, run_cmd
Expand Down Expand Up @@ -368,6 +369,14 @@ def __init__(self, target, *args, **kwargs):
if target.core not in self.SUPPORTED_CORES:
raise NotSupportedException(
"this compiler does not support the core %s" % target.core)
if CORE_ARCH[target.core] < 8:
self.notify.cc_info({
'severity': "Error", 'file': "", 'line': "", 'col': "",
'message': "ARMC6 does not support ARM architecture v{}"
" targets".format(CORE_ARCH[target.core]),
'text': '', 'target_name': self.target.name,
'toolchain_name': self.name
})

if not set(("ARM", "ARMC6")).intersection(set(target.supported_toolchains)):
raise NotSupportedException("ARM/ARMC6 compiler support is required for ARMC6 build")
Expand Down