Use mapping of core->arch ver. for tc picking

pull/7558/head
Jimmy Brisson 2018-07-19 10:55:35 -05:00
parent c030c6a52b
commit ae033da12f
2 changed files with 20 additions and 5 deletions

View File

@ -44,7 +44,7 @@ from .paths import (MBED_CMSIS_PATH, MBED_TARGETS_PATH, MBED_LIBRARIES,
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
@ -316,9 +316,7 @@ 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
target.core in ("Cortex-M23", "Cortex-M23-NS",
"Cortex-M33", "Cortex-M33-NS")):
if (toolchain_name == "ARM" and CORE_ARCH[target.core] == 8):
toolchain_name = "ARMC6"
try:

View File

@ -30,7 +30,7 @@ from tools.paths import TOOLS_BOOTLOADERS
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 = {
@ -50,6 +50,23 @@ CORE_LABELS = {
"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