Skip to content

Disallow building of mbed OS 2 + RTOS, and remove mbed OS 5 support for Cortext-A #4415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 2, 2017
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
4 changes: 2 additions & 2 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,7 @@
"inherits": ["Target"],
"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"],
"features": ["LWIP"],
"release_versions": ["2", "5"]
"release_versions": ["2"]
},
"VK_RZ_A1H": {
"inherits": ["Target"],
Expand All @@ -1938,7 +1938,7 @@
"device_has": ["ANALOGIN", "CAN", "ERROR_PATTERN", "ETHERNET", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"features": ["LWIP"],
"default_lib": "std",
"release_versions": ["2", "5"]
"release_versions": ["2"]
},
"MAXWSNENV": {
"inherits": ["Target"],
Expand Down
2 changes: 0 additions & 2 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from tools.targets import TARGET_NAMES, TARGET_MAP
from tools.options import get_default_options_parser
from tools.options import extract_profile
from tools.options import mcu_is_enabled
from tools.build_api import build_library, build_mbed_libs, build_lib
from tools.build_api import mcu_toolchain_matrix
from tools.build_api import print_build_results
Expand Down Expand Up @@ -136,7 +135,6 @@

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

# Get toolchains list
toolchains = options.tool if options.tool else TOOLCHAINS
Expand Down
16 changes: 11 additions & 5 deletions tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,10 @@ def build_project(src_paths, build_path, target, toolchain_name,
src_paths.extend(libraries_paths)
inc_dirs.extend(map(dirname, libraries_paths))

# Build Directory
if clean and exists(build_path):
rmtree(build_path)
mkdir(build_path)

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

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

row = [target] # First column is platform name
Expand Down
4 changes: 1 addition & 3 deletions tools/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt, vscode
from tools.export import gnuarmeclipse
from tools.export import qtcreator
from tools.targets import TARGET_NAMES, TARGET_MAP
from tools.targets import TARGET_NAMES

EXPORTERS = {
'uvision5': uvision.Uvision,
Expand Down Expand Up @@ -100,8 +100,6 @@ def mcu_ide_matrix(verbose_html=False):

perm_counter = 0
for target in sorted(TARGET_NAMES):
if "Cortex-A" in TARGET_MAP[target].core:
continue
row = [target] # First column is platform name
for ide in supported_ides:
text = "-"
Expand Down
6 changes: 2 additions & 4 deletions tools/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from tools.targets import TARGET_MAP
from tools.options import get_default_options_parser
from tools.options import extract_profile
from tools.options import mcu_is_enabled
from tools.build_api import build_project
from tools.build_api import mcu_toolchain_matrix
from tools.build_api import mcu_toolchain_list
Expand Down Expand Up @@ -202,7 +201,6 @@
if options.mcu is None :
args_error(parser, "argument -m/--mcu is required")
mcu = options.mcu[0]
assert mcu_is_enabled(parser, mcu)

# Toolchain
if options.tool is None:
Expand Down Expand Up @@ -315,8 +313,8 @@

except KeyboardInterrupt, e:
print "\n[CTRL+c] exit"
except NotSupportedException, e:
print "\nNot supported for selected target"
except NotSupportedException as e:
print "\nCould not compile for %s: %s" % (mcu, str(e))
except Exception,e:
if options.verbose:
import traceback
Expand Down
12 changes: 1 addition & 11 deletions tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from os import listdir
from argparse import ArgumentParser
from tools.toolchains import TOOLCHAINS
from tools.targets import TARGET_NAMES, TARGET_MAP
from tools.targets import TARGET_NAMES
from tools.utils import argparse_force_uppercase_type, \
argparse_lowercase_hyphen_type, argparse_many, \
argparse_filestring_type, args_error, argparse_profile_filestring_type,\
Expand Down Expand Up @@ -121,13 +121,3 @@ def extract_profile(parser, options, toolchain, fallback="develop"):
" supported by profile {}").format(toolchain,
filename))
return profile

def mcu_is_enabled(parser, mcu):
if "Cortex-A" in TARGET_MAP[mcu].core:
args_error(
parser,
("%s Will be supported in mbed OS 5.6. "
"To use the %s, please checkout the mbed OS 5.4 release branch. "
"See https://developer.mbed.org/platforms/Renesas-GR-PEACH/#important-notice "
"for more information") % (mcu, mcu))
return True
3 changes: 1 addition & 2 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from tools.utils import argparse_force_lowercase_type
from tools.utils import argparse_force_uppercase_type
from tools.utils import print_large_string
from tools.options import extract_profile, list_profiles, mcu_is_enabled
from tools.options import extract_profile, list_profiles

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

assert mcu_is_enabled(parser, options.mcu)
# Toolchain
if not options.ide:
args_error(parser, "argument -i is required")
Expand Down
2 changes: 0 additions & 2 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
from utils import argparse_dir_not_parent
from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS, TOOLCHAIN_CLASSES
from tools.settings import CLI_COLOR_MAP
from tools.options import mcu_is_enabled

if __name__ == '__main__':
try:
Expand Down Expand Up @@ -116,7 +115,6 @@
if options.mcu is None :
args_error(parser, "argument -m/--mcu is required")
mcu = options.mcu[0]
assert mcu_is_enabled(parser, mcu)

# Toolchain
if options.tool is None:
Expand Down
4 changes: 2 additions & 2 deletions tools/test/build_api/build_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_build_project_app_config(self, mock_prepare_toolchain, mock_exists, _,
mock_exists.return_value = False
mock_prepare_toolchain().link_program.return_value = 1, 2
mock_prepare_toolchain().config = namedtuple(
"Config", "has_regions name")(None, None)
"Config", "has_regions name lib_config_data")(None, None, {})

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

build_project(self.src_paths, self.build_path, self.target,
self.toolchain_name)
Expand Down