Skip to content

Check for mbed 5 support on export #4961

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 1 commit into from
Sep 27, 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
23 changes: 12 additions & 11 deletions tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,18 @@ def scan_resources(src_paths, toolchain, dependencies_paths=None,
# Set the toolchain's configuration data
toolchain.set_config_data(toolchain.config.get_config_data())

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")

return resources

def build_project(src_paths, build_path, target, toolchain_name,
Expand Down Expand Up @@ -519,17 +531,6 @@ 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
13 changes: 8 additions & 5 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +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.utils import NotSupportedException
from tools.options import extract_profile, list_profiles, extract_mcus

def setup_project(ide, target, program=None, source_dir=None, build=None, export_path=None):
Expand Down Expand Up @@ -246,11 +247,13 @@ def main():
profile = extract_profile(parser, options, toolchain_name, fallback="debug")
if options.clean:
rmtree(BUILD_DIR)
export(mcu, options.ide, build=options.build,
src=options.source_dir, macros=options.macros,
project_id=options.program, zip_proj=zip_proj,
build_profile=profile, app_config=options.app_config)

try:
export(mcu, options.ide, build=options.build,
src=options.source_dir, macros=options.macros,
project_id=options.program, zip_proj=zip_proj,
build_profile=profile, app_config=options.app_config)
except NotSupportedException as exc:
print "[ERROR] %s" % str(exc)

if __name__ == "__main__":
main()