Merge pull request #13202 from devran01/tools-release-6.1.0

Tools release 6.1.0
tools-release-6.1.0 tools-release-6.1.0-0
Martin Kojtal 2020-06-29 14:25:37 +02:00 committed by GitHub
commit 3a9848eb3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 2848 additions and 123 deletions

View File

@ -175,54 +175,6 @@ matrix:
sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
### Python Tests ###
- &pytools-vm
stage: "Pytest"
name: "tools-py27"
env: NAME=tools-py2.7
language: python
python: 2.7
install:
# Install gcc
- source_pkg gcc
- arm-none-eabi-gcc --version
# Install additional python modules
- python --version
- |-
tr -d ' ' >> requirements.txt <<< "
mock==2.0.0
pytest==3.3.0
pylint>=1.9,<2
hypothesis>=3,<4
coverage>=4.5,<5
"
- python -m pip install --upgrade pip==18.1
- python -m pip install --upgrade setuptools==40.4.3
- pip install -r requirements.txt
- pip list --verbose
script:
# Run local testing on tools
- PYTHONPATH=. coverage run -a -m pytest tools/test
- python tools/test/pylint.py
- coverage run -a tools/project.py -S | sed -n '/^Total/p'
- coverage html
- <<: *pytools-vm
name: "tools-py35"
env: NAME=tools-py3.5
python: 3.5
- <<: *pytools-vm
name: "tools-py36"
env: NAME=tools-py3.6
python: 3.6
- <<: *pytools-vm
name: "tools-py37"
env: NAME=tools-py3.7
python: 3.7
### Extended Tests ###
- &extended-vm
stage: "Extended"

View File

@ -44,13 +44,20 @@ 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, CORE_ARCH, Target
from .targets import (
TARGET_NAMES,
TARGET_MAP,
CORE_ARCH,
Target,
set_targets_json_location
)
from .libraries import Library
from .toolchains import TOOLCHAIN_CLASSES, TOOLCHAIN_PATHS
from .toolchains import TOOLCHAIN_CLASSES, TOOLCHAIN_PATHS, mbedToolchain
from .toolchains.arm import ARMC5_MIGRATION_WARNING
from .toolchains.arm import UARM_TOOLCHAIN_WARNING
from .toolchains.mbed_toolchain import should_replace_small_c_lib
from .config import Config
from .build_profiles import find_build_profile, get_toolchain_profile, find_targets_json
RELEASE_VERSIONS = ['2', '5']
@ -409,15 +416,6 @@ def get_mbed_official_release(version, profile=None):
version - The version string. Should be a string contained within
RELEASE_VERSIONS
"""
# we ignore version for Mbed 6 as all targets in targets.json file are being supported
# if someone passes 2, we return empty tuple, if 5, we keep the behavior the same as
# release version is deprecated and all targets are being supported that are present
# in targets.json file
if version == '2':
return tuple(tuple([]))
mbed_official_release = (
tuple(
tuple(
@ -426,11 +424,18 @@ def get_mbed_official_release(version, profile=None):
tuple(transform_release_toolchains(
TARGET_MAP[target], version))
]
) for target in TARGET_NAMES \
if not profile or profile in TARGET_MAP[target].supported_application_profiles
) for target in TARGET_NAMES
if (hasattr(TARGET_MAP[target], 'release_versions')
and version in TARGET_MAP[target].release_versions)
)
)
for target in mbed_official_release:
is_official, reason = is_official_target(target[0], version)
if not is_official:
raise InvalidReleaseTargetException(reason)
return mbed_official_release
def target_supports_toolchain(target, toolchain_name):
@ -576,6 +581,43 @@ def build_project(src_paths, build_path, target, toolchain_name,
rmtree(build_path)
mkdir(build_path)
###################################
# mbed Classic/2.0/libary support #
# Find build system profile
profile = None
targets_json = None
for path in src_paths:
profile = find_build_profile(path) or profile
if profile:
targets_json = join(dirname(abspath(__file__)), 'legacy_targets.json')
else:
targets_json = find_targets_json(path) or targets_json
# Apply targets.json to active targets
if targets_json:
notify.info("Using targets from %s" % targets_json)
set_targets_json_location(targets_json)
# Apply profile to toolchains
if profile:
def init_hook(self):
profile_data = get_toolchain_profile(self.name, profile)
if not profile_data:
return
notify.info("Using toolchain %s profile %s" % (self.name, profile))
for k,v in profile_data.items():
if self.flags.has_key(k):
self.flags[k] = v
else:
setattr(self, k, v)
mbedToolchain.init = init_hook
# mbed Classic/2.0/libary support #
###################################
toolchain = prepare_toolchain(
src_paths, build_path, target, toolchain_name, macros=macros,
clean=clean, jobs=jobs, notify=notify, config=config,

328
tools/build_profiles.py Normal file
View File

@ -0,0 +1,328 @@
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import re
import tempfile
import colorama
from copy import copy
from os.path import join, abspath, exists
from os import walk
import fnmatch
def get_toolchain_profile(toolchain, profile):
if profile and (TOOLCHAIN_PROFILES.get(toolchain, None) and
TOOLCHAIN_PROFILES[toolchain].get(profile)):
return TOOLCHAIN_PROFILES[toolchain].get(profile)
def find_build_profile(path):
profile = None
builds = find_build_ids(path)
for build in builds:
if build in MBED_SDK_REV_MAP:
idx = MBED_SDK_REV_MAP[build]
if idx <= 43:
profile = 'v1'
elif idx <= 68:
profile = 'v2'
elif idx <= 76:
profile = 'v3'
elif idx <= 105:
profile = 'v4'
elif idx <= 135:
profile = 'v5'
return profile
def find_build_ids(path):
builds = []
for (root, dirs, files) in walk(path):
for d in copy(dirs):
if d.startswith('.'):
dirs.remove(d)
for filename in filter(lambda s: s.endswith(".bld"), files):
try:
url = open(join(root, filename), 'r').read().strip()
builds.append(re.sub(r'^.+/(.*?)$', r'\1', url))
except:
pass
return builds
def find_targets_json(path, depth=1):
f = 'targets.json'
if exists(join(path, f)):
return abspath(join(path, f))
if depth > 2:
return None
for root, dirs, files in walk(path):
for d in copy(dirs):
if d.startswith('.'):
dirs.remove(d)
continue
if exists(join(root, d, f)):
return abspath(join(root, d, f))
else:
found = find_targets_json(join(root, d), depth+1)
if found:
return found
return None
# Toolchain profiles for backward compatibility with old mbed SDK library releases
TOOLCHAIN_PROFILES = {
'ARM_STD' : {
'v5': {
'version': '5.06',
'common': ['-c', '--gnu', '-O3', '-Otime', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp', '--no_rtti'],
'COMPILE_C_AS_CPP': False,
},
'v4': {
'version': '5.03',
'common': ['-c', '--gnu', '-O3', '-Otime', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp', '--no_rtti'],
'COMPILE_C_AS_CPP': False,
},
'v3': {
'version': '5.01',
'common': ['-c', '--gnu', '-Ospace', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp', '--no_rtti'],
'COMPILE_C_AS_CPP': False,
},
'v2': {
'version': '5.01',
'common': ['-c', '--gnu', '-Ospace', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp', '--no_rtti'],
'COMPILE_C_AS_CPP': False,
},
'v1': {
'version': '4',
'common': ['-c', '--gnu', '-Otime', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp'],
'COMPILE_C_AS_CPP': True,
}
},
'ARM_MICRO' : {
'v5': {
'version': '5.06',
'common': ['-c', '--gnu', '-O3', '-Otime', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp', '--no_rtti'],
},
'v4': {
'version': '5.03',
'common': ['-c', '--gnu', '-O3', '-Otime', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp', '--no_rtti'],
},
'v3': {
'version': '5.01',
'common': ['-c', '--gnu', '-Ospace', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp', '--no_rtti'],
},
'v2': {
'version': '4',
'common': ['-c', '--gnu', '-Ospace', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp', '--no_rtti'],
'PATCHED_LIBRARY' : True,
},
'v1': {
'version': '4.1',
'common': ['-c', '--gnu', '-Otime', '--split_sections', '--apcs=interwork'],
'cxx': ['--cpp'],
'COMPILE_C_AS_CPP': True,
'PATCHED_LIBRARY' : True,
}
},
'GCC_ARM' : {
'v5': {
'ld': ['-Wl,--gc-sections', '-Wl,--wrap,main'],
},
'v4': {
'ld': ['-Wl,--gc-sections', '-Wl,--wrap,main'],
},
'v3': {
'ld': ['-Wl,--gc-sections', '-Wl,--wrap,main'],
},
'v2': {
'common': ["-c", "-Wall", "-fmessage-length=0", "-fno-exceptions", "-fno-builtin", "-ffunction-sections", "-fdata-sections"],
'cxx': ['-std=gnu++98'],
'ld': ['-Wl,--gc-sections'],
},
'v1': {
'common': ["-c", "-Wall", "-fmessage-length=0", "-fno-exceptions", "-fno-builtin", "-ffunction-sections", "-fdata-sections"],
'cxx': ['-std=gnu++98'],
'ld': ['-Wl,--gc-sections'],
}
}
}
MBED_SDK_REV_MAP = {
'6f4d9ba055b3': 122,
'c1a077c0ccc5': 123,
'f1e13e937fab': 124,
'a974dc8aa35b': 125,
'4132e2258101': 126,
'62ea7dd49f26': 127,
'e6f9c99959f3': 128,
'31768d6a83cd': 129,
'620374818e03': 130,
'f4b892cad2b9': 131,
'9c0c086c88f0': 132,
'a1e1b8eadde3': 133,
'1a303c31ec8f': 134,
'0b434d521da0': 135,
'2abc4044d39c': 136,
'c2078c12af99': 137,
'86e42d5e9f93': 138,
'4ba4acebdbae': 139,
'608e850de46b': 140,
'd616554d63fc': 141,
'46ffe6167a0b': 142,
'c417c1db60ce': 143,
'6b1076ac9921': 144,
'6c34061e7c34': 121,
'7c328cabac7e': 120,
'aae6fcc7d9bb': 119,
'082adc85693f': 118,
'99a22ba036c9': 117,
'c0f6e94411f5': 116,
'87f2f5183dfb': 115,
'252557024ec3': 114,
'f141b2784e32': 113,
'6f327212ef96': 112,
'4336505e4b1c': 111,
'165afa46840b': 110,
'9296ab0bfc11': 109,
'34e6b704fe68': 108,
'4f6c30876dfa': 107,
'ba1f97679dad': 106,
'8ed44a420e5c': 105,
'b9ad9a133dc7': 104,
'bad568076d81': 103,
'da0ca467f8b5': 102,
'7cff1c4259d7': 101,
'cbbeb26dbd92': 100,
'dbbf35b96557': 99,
'8ab26030e058': 98,
'433970e64889': 97,
'487b796308b0': 96,
'7e07b6fb45cf': 95,
'9ad691361fac': 94,
'e188a91d3eaa': 93,
'4fc01daae5a5': 92,
'031413cf7a89': 91,
'cb3d968589d8': 90,
'552587b429a1': 89,
'9327015d4013': 88,
'6213f644d804': 87,
'04dd9b1680ae': 86,
'024bf7f99721': 85,
'0b3ab51c8877': 84,
'8a40adfe8776': 83,
'6473597d706e': 82,
'7d30d6019079': 81,
'8e73be2a2ac1': 80,
'0c05e21ae27e': 79,
'ed8466a608b4': 78,
'869cf507173a': 77,
'824293ae5e43': 76,
'dc225afb6914': 75,
'a842253909c9': 74,
'1efda918f0ba': 73,
'4096f863f923': 72,
'8fabd470bb6e': 71,
'673126e12c73': 70,
'4a7918f48478': 69,
'f37f3b9c9f0b': 68,
'a9913a65894f': 67,
'9c8f0e3462fb': 66,
'5798e58a58b1': 65,
'e3affc9e7238': 64,
'b3110cd2dd17': 63,
'7e6c9f46b3bd': 62,
'5e5da4a5990b': 61,
'3d0ef94e36ec': 60,
'0883845fe643': 59,
'0954ebd79f59': 58,
'0480438fc29c': 57,
'3753e96f3c8b': 56,
'd722ed6a4237': 55,
'71b101360fb9': 54,
'63cdd78b2dc1': 53,
'09236a68d21b': 52,
'a076018f59af': 51,
'b60934f96c0c': 50,
'eeb8a2a33ec9': 49,
'49c296715c73': 48,
'134def52cfa0': 47,
'890817bdcffb': 46,
'3d775a932e1d': 45,
'24d45a770a51': 44,
'e2ed12d17f06': 43,
'cd19af002ccc': 42,
'10b9abbe79a6': 41,
'976df7c37ad5': 40,
'737756e0b479': 39,
'4c0c40fd0593': 38,
'14f4805c468c': 37,
'b4b9f287a47e': 36,
'5284544d04b6': 35,
'7495d544864f': 34,
'5364839841bd': 33,
'3b05dd009342': 32,
'a7ef757f598c': 31,
'3991a86798e3': 30,
'078e4b97a13e': 29,
'667d61c9177b': 28,
'7110ebee3484': 27,
'63bcd7ba4912': 26,
'9a9732ce53a1': 25,
'e2ac27c8e93e': 24,
'74b8d43b5817': 23,
'9114680c05da': 22,
'3944f1e2fa4f': 21,
'029aa53d7323': 20,
'e6be4cd80aad': 19,
'b3c9f16cbb96': 18,
'49a220cc26e0': 17,
'32af5db564d4': 16,
'd1a9de3f4fe0': 15,
'20a79241b4a0': 14,
'a0336ede94ce': 13,
'f63353af7be8': 12,
'1c1ebd0324fa': 11,
'fcb9359f0959': 10,
'cf0d45ce28a6': 9,
'00a04e5cd407': 8,
'15d74db76485': 7,
'3fd6a337c7cc': 6,
'62573be585e9': 5,
'5d1359a283bc': 4,
'aefd12a1f1c5': 3,
'969fc1867111': 2,
'6b7f447ca868': 1,
'82220227f4fa': 0,
}

View File

@ -1338,14 +1338,6 @@ class Config(object):
self.cumulative_overrides['features']\
.update_target(self.target)
# Features that don't appear in ALLOWED_FEATURES should be removed
# with a warning so that they don't do anything unexpected.
# Iterate over a copy of the set to remove them safely.
for feature in list(self.target.features):
if feature not in ALLOWED_FEATURES:
print("[WARNING] Feature '%s' is not a supported feature" % feature)
self.target.features.remove(feature)
return self.target.features
def validate_config(self):

View File

@ -5560,7 +5560,9 @@
"WSF_MAX_HANDLERS=10",
"MBED_MPU_CUSTOM",
"SWI_DISABLE0",
"NRF52_PAN_20"
"NRF52_PAN_20",
"UART_TWO_STOP_BITS_NOT_SUPPORTED",
"UART_ODD_PARITY_NOT_SUPPORTED"
],
"features": [
"CRYPTOCELL310",
@ -7210,60 +7212,560 @@
"3701"
]
},
"NUCLEO_G474RE": {
"__build_tools_metadata__": {
"version": "1",
"public": false
},
"MCU_NRF51": {
"inherits": [
"MCU_STM32"
"Target"
],
"supported_form_factors": [
"ARDUINO",
"MORPHO"
"core": "Cortex-M0",
"OVERRIDE_BOOTLOADER_FILENAME": "nrf51822_bootloader.hex",
"macros": [
"NRF51",
"NRF5x",
"TARGET_NRF51822",
"CMSIS_VECTAB_VIRTUAL",
"CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\""
],
"core": "Cortex-M4F",
"config": {
"clock_source": {
"help": "Mask value : USE_PLL_HSE_EXTC | USE_PLL_HSE_XTAL (need HW patch) | USE_PLL_HSI",
"value": "USE_PLL_HSE_XTAL",
"macro_name": "CLOCK_SOURCE"
"MERGE_BOOTLOADER": false,
"extra_labels": [
"NORDIC",
"MCU_NRF51",
"MCU_NRF51822"
],
"OUTPUT_EXT": "hex",
"is_disk_virtual": true,
"supported_toolchains": [
"ARM",
"GCC_ARM"
],
"public": false,
"MERGE_SOFT_DEVICE": true,
"EXPECTED_SOFTDEVICES_WITH_OFFSETS": [
{
"boot": "s130_nrf51_1.0.0_bootloader.hex",
"name": "s130_nrf51_1.0.0_softdevice.hex",
"offset": 114688
},
"lpticker_lptim": {
"help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
"value": 1
{
"boot": "s110_nrf51822_8.0.0_bootloader.hex",
"name": "s110_nrf51822_8.0.0_softdevice.hex",
"offset": 98304
},
"hse_value": {
"help": "HSE default value is 25MHz in HAL",
"value": "24000000",
"macro_name": "HSE_VALUE"
{
"boot": "s110_nrf51822_7.1.0_bootloader.hex",
"name": "s110_nrf51822_7.1.0_softdevice.hex",
"offset": 90112
},
{
"boot": "s110_nrf51822_7.0.0_bootloader.hex",
"name": "s110_nrf51822_7.0.0_softdevice.hex",
"offset": 90112
},
{
"boot": "s110_nrf51822_6.0.0_bootloader.hex",
"name": "s110_nrf51822_6.0.0_softdevice.hex",
"offset": 81920
}
},
"extra_labels_add": [
"STM32G4",
"STM32G474xx",
"STM32G474RE"
],
"components_add": [
"FLASHIAP"
],
"macros_add": [
"STM32G474xx",
"STM32G474RE",
"EXTRA_IDLE_STACK_REQUIRED",
"MBED_TICKLESS"
],
"overrides": {
"lpticker_delay_ticks": 0
},
"device_has_add": [
"ANALOGOUT",
"FLASH",
"MPU"
],
"detect_code": [
"0841"
"1070"
],
"post_binary_hook": {
"function": "MCU_NRF51Code.binary_hook",
"toolchains": [
"ARM_STD",
"GCC_ARM"
]
},
"program_cycle_s": 6,
"device_has": [
"ANALOGIN",
"I2C",
"INTERRUPTIN",
"PORTIN",
"PORTINOUT",
"PORTOUT",
"PWMOUT",
"SERIAL",
"SLEEP",
"SPI",
"SPISLAVE",
"USTICKER"
],
"overrides": {
"tickless-from-us-ticker": true,
"boot-stack-size": "0x400"
}
},
"MCU_NRF51_16K_BASE": {
"inherits": [
"MCU_NRF51"
],
"extra_labels_add": [
"MCU_NORDIC_16K",
"MCU_NRF51_16K"
],
"macros_add": [
"TARGET_MCU_NORDIC_16K",
"TARGET_MCU_NRF51_16K"
],
"public": false,
"default_lib": "small"
},
"MCU_NRF51_16K_BOOT_BASE": {
"inherits": [
"MCU_NRF51_16K_BASE"
],
"MERGE_BOOTLOADER": true,
"extra_labels_add": [
"MCU_NRF51_16K_BOOT"
],
"macros_add": [
"TARGET_MCU_NRF51_16K_BOOT",
"TARGET_OTA_ENABLED"
],
"public": false
},
"MCU_NRF51_16K_OTA_BASE": {
"inherits": [
"MCU_NRF51_16K_BASE"
],
"public": false,
"extra_labels_add": [
"MCU_NRF51_16K_OTA"
],
"macros_add": [
"TARGET_MCU_NRF51_16K_OTA",
"TARGET_OTA_ENABLED"
],
"MERGE_SOFT_DEVICE": false
},
"MCU_NRF51_16K": {
"inherits": [
"MCU_NRF51_16K_BASE"
],
"extra_labels_add": [
"MCU_NRF51_16K_S130"
],
"macros_add": [
"TARGET_MCU_NRF51_16K_S130"
],
"public": false
},
"MCU_NRF51_S110": {
"extra_labels_add": [
"MCU_NRF51_16K_S110"
],
"macros_add": [
"TARGET_MCU_NRF51_16K_S110"
],
"EXPECTED_SOFTDEVICES_WITH_OFFSETS": [
{
"name": "s110_nrf51822_8.0.0_softdevice.hex",
"boot": "s110_nrf51822_8.0.0_bootloader.hex",
"offset": 98304
},
{
"name": "s110_nrf51822_7.1.0_softdevice.hex",
"boot": "s110_nrf51822_7.1.0_bootloader.hex",
"offset": 90112
}
],
"public": false
},
"MCU_NRF51_16K_S110": {
"inherits": [
"MCU_NRF51_S110",
"MCU_NRF51_16K_BASE"
],
"public": false
},
"MCU_NRF51_16K_BOOT": {
"inherits": [
"MCU_NRF51_16K_BOOT_BASE"
],
"extra_labels_add": [
"MCU_NRF51_16K_S130"
],
"macros_add": [
"TARGET_MCU_NRF51_16K_S130"
],
"public": false
},
"MCU_NRF51_16K_BOOT_S110": {
"inherits": [
"MCU_NRF51_S110",
"MCU_NRF51_16K_BOOT_BASE"
],
"public": false
},
"MCU_NRF51_16K_OTA": {
"inherits": [
"MCU_NRF51_16K_OTA_BASE"
],
"extra_labels_add": [
"MCU_NRF51_16K_S130"
],
"macros_add": [
"TARGET_MCU_NRF51_16K_S130"
],
"public": false
},
"MCU_NRF51_16K_OTA_S110": {
"inherits": [
"MCU_NRF51_S110",
"MCU_NRF51_16K_OTA_BASE"
],
"public": false
},
"MCU_NRF51_32K": {
"inherits": [
"MCU_NRF51"
],
"extra_labels_add": [
"MCU_NORDIC_32K",
"MCU_NRF51_32K"
],
"macros_add": [
"TARGET_MCU_NORDIC_32K",
"TARGET_MCU_NRF51_32K"
],
"public": false
},
"MCU_NRF51_32K_BOOT": {
"inherits": [
"MCU_NRF51_32K"
],
"MERGE_BOOTLOADER": true,
"extra_labels_add": [
"MCU_NRF51_32K_BOOT"
],
"macros_add": [
"TARGET_MCU_NRF51_32K_BOOT",
"TARGET_OTA_ENABLED"
],
"public": false
},
"MCU_NRF51_32K_OTA": {
"inherits": [
"MCU_NRF51_32K"
],
"public": false,
"extra_labels_add": [
"MCU_NRF51_32K_OTA"
],
"macros_add": [
"TARGET_MCU_NRF51_32K_OTA",
"TARGET_OTA_ENABLED"
],
"MERGE_SOFT_DEVICE": false
},
"NRF51822": {
"inherits": [
"MCU_NRF51_16K"
],
"extra_labels_add": [
"NRF51822",
"NRF51822_MKIT"
],
"macros_add": [
"TARGET_NRF51822_MKIT"
],
"release_versions": [
"2"
],
"device_name": "nRF51822_xxAA",
"detect_code": [
"1070"
]
},
"NRF51822_BOOT": {
"inherits": [
"MCU_NRF51_16K_BOOT"
],
"extra_labels_add": [
"NRF51822",
"NRF51822_MKIT"
],
"macros_add": [
"TARGET_NRF51822_MKIT"
]
},
"NRF51822_OTA": {
"inherits": [
"MCU_NRF51_16K_OTA"
],
"extra_labels_add": [
"NRF51822",
"NRF51822_MKIT"
],
"macros_add": [
"TARGET_NRF51822_MKIT"
],
"detect_code": [
"1075"
]
},
"NRF51_DK_LEGACY": {
"supported_form_factors": [
"ARDUINO"
],
"inherits": [
"MCU_NRF51_32K"
],
"extra_labels_add": [
"NRF51_DK"
]
},
"NRF51_DK_BOOT": {
"supported_form_factors": [
"ARDUINO"
],
"inherits": [
"MCU_NRF51_32K_BOOT"
],
"extra_labels_add": [
"NRF51_DK"
],
"macros_add": [
"TARGET_NRF51_DK"
]
},
"NRF51_DK_OTA": {
"supported_form_factors": [
"ARDUINO"
],
"inherits": [
"MCU_NRF51_32K_OTA"
],
"extra_labels_add": [
"NRF51_DK"
],
"macros_add": [
"TARGET_NRF51_DK"
],
"detect_code": [
"1105"
]
},
"NRF51_MICROBIT": {
"inherits": [
"MCU_NRF51_16K_S110"
],
"macros_add": [
"TARGET_NRF_LFCLK_RC"
],
"release_versions": [
"2"
],
"device_name": "nRF51822_xxAA",
"supported_toolchains": [
"ARMC5",
"GCC_ARM"
],
"detect_code": [
"9900"
]
},
"NRF51_MICROBIT_BOOT": {
"inherits": [
"MCU_NRF51_16K_BOOT_S110"
],
"extra_labels_add": [
"NRF51_MICROBIT"
],
"macros_add": [
"TARGET_NRF51_MICROBIT",
"TARGET_NRF_LFCLK_RC"
]
},
"NRF51_MICROBIT_OTA": {
"inherits": [
"MCU_NRF51_16K_OTA_S110"
],
"extra_labels_add": [
"NRF51_MICROBIT"
],
"macros_add": [
"TARGET_NRF51_MICROBIT",
"TARGET_NRF_LFCLK_RC"
]
},
"NRF51_MICROBIT_B": {
"inherits": [
"MCU_NRF51_16K"
],
"extra_labels_add": [
"NRF51_MICROBIT"
],
"macros_add": [
"TARGET_NRF51_MICROBIT",
"TARGET_NRF_LFCLK_RC"
],
"release_versions": [
"2"
]
},
"NRF51_MICROBIT_B_BOOT": {
"inherits": [
"MCU_NRF51_16K_BOOT"
],
"extra_labels_add": [
"NRF51_MICROBIT"
],
"macros_add": [
"TARGET_NRF51_MICROBIT",
"TARGET_NRF_LFCLK_RC"
]
},
"NRF51_MICROBIT_B_OTA": {
"inherits": [
"MCU_NRF51_16K_OTA"
],
"extra_labels_add": [
"NRF51_MICROBIT"
],
"macros_add": [
"TARGET_NRF51_MICROBIT",
"TARGET_NRF_LFCLK_RC"
]
},
"MCU_NRF51_UNIFIED": {
"inherits": [
"Target"
],
"core": "Cortex-M0",
"OVERRIDE_BOOTLOADER_FILENAME": "nrf51822_bootloader.hex",
"macros": [
"BOARD_PCA10028",
"NRF51",
"TARGET_NRF51822",
"TARGET_MCU_NRF51822",
"CMSIS_VECTAB_VIRTUAL",
"CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\"",
"NO_SYSTICK",
"MBED_TICKLESS"
],
"MERGE_BOOTLOADER": false,
"extra_labels": [
"NORDIC",
"MCU_NRF51",
"MCU_NRF51822_UNIFIED",
"NRF5x",
"NRF51"
],
"OUTPUT_EXT": "hex",
"is_disk_virtual": true,
"supported_toolchains": [
"ARM",
"GCC_ARM",
"IAR"
],
"public": false,
"detect_code": [
"1070"
],
"post_binary_hook": {
"function": "MCU_NRF51Code.binary_hook",
"toolchains": [
"ARM_STD",
"GCC_ARM",
"IAR"
]
},
"program_cycle_s": 6,
"config": {
"lf_clock_src": {
"value": "NRF_LF_SRC_XTAL",
"macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC"
},
"uart_hwfc": {
"help": "Value: 1 for enable, 0 for disable",
"value": 1,
"macro_name": "MBED_CONF_NORDIC_UART_HWFC"
}
},
"device_has": [
"ANALOGIN",
"I2C",
"INTERRUPTIN",
"PORTIN",
"PORTINOUT",
"PORTOUT",
"PWMOUT",
"SERIAL",
"SLEEP",
"SPI",
"SPISLAVE"
]
},
"MCU_NRF51_16K_UNIFIED_S130": {
"inherits": [
"MCU_NRF51_UNIFIED"
],
"extra_labels_add": [
"MCU_NORDIC_16K",
"MCU_NRF51_16K_S130",
"MCU_NRF51_16K"
],
"macros_add": [
"TARGET_MCU_NORDIC_16K",
"TARGET_MCU_NRF51_16K_S130",
"TARGET_MCU_NRF51_16K"
],
"public": false
},
"MCU_NRF51_32K_UNIFIED": {
"inherits": [
"MCU_NRF51_UNIFIED"
],
"extra_labels_add": [
"MCU_NORDIC_32K",
"MCU_NRF51_32K"
],
"macros_add": [
"TARGET_MCU_NORDIC_32K",
"TARGET_MCU_NRF51_32K"
],
"public": false
},
"NRF51_DK": {
"supported_form_factors": [
"ARDUINO"
],
"inherits": [
"MCU_NRF51_32K_UNIFIED"
],
"device_has": [
"USTICKER",
"LPTICKER",
"ANALOGIN",
"I2C",
"I2C_ASYNCH",
"INTERRUPTIN",
"PORTIN",
"PORTINOUT",
"PORTOUT",
"PWMOUT",
"SERIAL",
"SERIAL_ASYNCH",
"SERIAL_FC",
"SLEEP",
"SPI",
"SPI_ASYNCH",
"SPISLAVE"
],
"release_versions": [
"2",
"5"
],
"device_name": "STM32G474RETx"
"device_name": "nRF51822_xxAC",
"detect_code": [
"1100"
]
},
"EP_ATLAS": {
"inherits": ["MCU_NRF52840"],
@ -7287,9 +7789,5 @@
"macros_add": [
"CONFIG_GPIO_AS_PINRESET"
]
},
"__build_tools_metadata__": {
"version": "1",
"public": false
}
}

1859
tools/legacy_targets.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ from tools.export import (
)
from tools.tests import TESTS, TEST_MAP
from tools.tests import test_known, test_name_known, Test
from tools.targets import TARGET_NAMES, Target
from tools.targets import TARGET_NAMES, Target, set_targets_json_location
from tools.utils import (
argparse_filestring_type,
argparse_profile_filestring_type,
@ -53,6 +53,8 @@ from tools.utils import print_large_string
from tools.utils import NotSupportedException
from tools.options import extract_profile, list_profiles, extract_mcus
from tools.notifier.term import TerminalNotifier
from tools.build_profiles import find_targets_json, find_build_profile, get_toolchain_profile
from tools.toolchains import mbedToolchain
""" The CLI entry point for exporting projects from the mbed tools to any of the
supported IDEs or project structures.
@ -145,6 +147,43 @@ def export(target, ide, build=None, src=None, macros=None, project_id=None,
Returns an object of type Exporter (tools/exports/exporters.py)
"""
###################################
# mbed Classic/2.0/libary support #
# Find build system profile
profile = None
targets_json = None
for path in src:
profile = find_build_profile(path) or profile
if profile:
targets_json = join(dirname(dirname(abspath(__file__))), 'legacy_targets.json')
else:
targets_json = find_targets_json(path) or targets_json
# Apply targets.json to active targets
if targets_json:
notify.info("Using targets from %s" % targets_json)
set_targets_json_location(targets_json)
# Apply profile to toolchains
if profile:
def init_hook(self):
profile_data = get_toolchain_profile(self.name, profile)
if not profile_data:
return
notify.info("Using toolchain %s profile %s" % (self.name, profile))
for k,v in profile_data.items():
if self.flags.has_key(k):
self.flags[k] = v
else:
setattr(self, k, v)
mbedToolchain.init = init_hook
# mbed Classic/2.0/libary support #
###################################
project_dir, name, src, lib = setup_project(
ide,
target,
@ -187,6 +226,11 @@ def clean(source_dir):
except (IOError, OSError):
pass
return export_project(src, project_dir, target, ide, name=name,
macros=macros, libraries_paths=lib, zip_proj=zip_name,
build_profile=build_profile, notify=notify,
app_config=app_config, ignore=ignore)
def get_args(argv):
parser = ArgumentParser()

View File

@ -199,7 +199,7 @@ class Target(namedtuple(
# Default location of the 'targets.json' file
__targets_json_location_default = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'..', '..', 'targets', 'targets.json'
'..', 'latest_targets.json'
)
# Current/new location of the 'targets.json' file
@ -711,6 +711,21 @@ class ArmMuscaB1Code(object):
)
musca_tfm_bin(t_self, binf, secure_bin)
class LPC55S69Code(object):
"""LPC55S69 Hooks"""
@staticmethod
def binary_hook(t_self, resources, elf, binf):
from tools.targets.LPC55S69 import lpc55s69_complete
configured_secure_image_filename = t_self.target.secure_image_filename
secure_bin = find_secure_image(
t_self.notify,
resources,
binf,
configured_secure_image_filename,
FileType.BIN
)
lpc55s69_complete(t_self, binf, secure_bin)
def find_secure_image(notify, resources, ns_image_path,
configured_s_image_filename, image_type):
""" Find secure image. """

View File

@ -1097,11 +1097,6 @@ class mbedToolchain(with_metaclass(ABCMeta, object)):
target.c_lib is modified to have the lowercased string of its original string.
This is done to be case insensitive when validating.
"""
if hasattr(target, "default_lib"):
# Use default_lib as the c_lib attribute. This allows backwards
# compatibility with older target definitions, allowing either
# default_lib or c_lib to specify the C library to use.
target.c_lib = target.default_lib.lower()
if hasattr(target, "c_lib"):
target.c_lib = target.c_lib.lower()
if (