Skip to content

Commit bb0baee

Browse files
authored
Merge pull request #10347 from bridadan/allow_mbed_2_builds
Fix detection of supported targets for mbed 2 builds
2 parents 8e02592 + 11775ef commit bb0baee

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

targets/targets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6650,7 +6650,7 @@
66506650
"TC_ASYNC=true"
66516651
],
66526652
"extra_labels": ["Atmel", "SAM_CortexM0P", "SAMR21"],
6653-
"supported_toolchains": ["GCC_ARM", "ARM", "uARM"],
6653+
"supported_toolchains": ["GCC_ARM", "ARMC5", "uARM"],
66546654
"device_has": [
66556655
"ANALOGIN",
66566656
"I2C",
@@ -6683,7 +6683,7 @@
66836683
"TC_ASYNC=true"
66846684
],
66856685
"extra_labels": ["Atmel", "SAM_CortexM0P", "SAMD21"],
6686-
"supported_toolchains": ["GCC_ARM", "ARM", "uARM"],
6686+
"supported_toolchains": ["GCC_ARM", "ARMC5", "uARM"],
66876687
"device_has": [
66886688
"ANALOGIN",
66896689
"ANALOGOUT",
@@ -6717,7 +6717,7 @@
67176717
"TC_ASYNC=true"
67186718
],
67196719
"extra_labels": ["Atmel", "SAM_CortexM0P", "SAMD21"],
6720-
"supported_toolchains": ["GCC_ARM", "ARM", "uARM"],
6720+
"supported_toolchains": ["GCC_ARM", "ARMC5", "uARM"],
67216721
"device_has": [
67226722
"ANALOGIN",
67236723
"ANALOGOUT",
@@ -6751,7 +6751,7 @@
67516751
"TC_ASYNC=true"
67526752
],
67536753
"extra_labels": ["Atmel", "SAM_CortexM0P", "SAML21"],
6754-
"supported_toolchains": ["GCC_ARM", "ARM", "uARM"],
6754+
"supported_toolchains": ["GCC_ARM", "ARMC5", "uARM"],
67556755
"device_has": [
67566756
"ANALOGIN",
67576757
"ANALOGOUT",

tools/build.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,8 @@ def main():
182182
except NoValidToolchainException as e:
183183
print_end_warnings(e.end_warnings)
184184
args_error(parser, str(e))
185-
186185
tt_id = "%s::%s" % (internal_tc_name, target_name)
187-
if not target_supports_toolchain(target, toolchain):
186+
if not target_supports_toolchain(target, toolchain_name):
188187
# Log this later
189188
print("%s skipped: toolchain not supported" % tt_id)
190189
skipped.append(tt_id)
@@ -196,7 +195,6 @@ def main():
196195
if target.is_PSA_secure_target and \
197196
not is_relative_to_root(options.source_dir):
198197
options.source_dir = ROOT
199-
200198
if options.source_dir:
201199
lib_build_res = build_library(
202200
options.source_dir, options.build_dir, target, toolchain_name,

tools/build_api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,6 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None,
988988
#then set the default_toolchain to uARM to link AC6 microlib.
989989
if(selected_toolchain_name == "ARMC6" and toolchain_name == "uARM"):
990990
target.default_toolchain = "uARM"
991-
toolchain_name = selected_toolchain_name
992991

993992
if report is not None:
994993
start = time()
@@ -1003,7 +1002,7 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None,
10031002
prep_properties(
10041003
properties, target.name, toolchain_name, vendor_label)
10051004

1006-
if toolchain_name not in target.supported_toolchains:
1005+
if not target_supports_toolchain(target, toolchain_name):
10071006
supported_toolchains_text = ", ".join(target.supported_toolchains)
10081007
notify.info('The target {} does not support the toolchain {}'.format(
10091008
target.name,
@@ -1023,14 +1022,16 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None,
10231022

10241023
try:
10251024
# Source and Build Paths
1025+
10261026
build_toolchain = join(
1027-
MBED_LIBRARIES, mbed2_obj_path(target.name, toolchain_name))
1027+
MBED_LIBRARIES, mbed2_obj_path(target.name, selected_toolchain_name)
1028+
)
10281029
mkdir(build_toolchain)
10291030

10301031
tmp_path = join(
10311032
MBED_LIBRARIES,
10321033
'.temp',
1033-
mbed2_obj_path(target.name, toolchain_name)
1034+
mbed2_obj_path(target.name, selected_toolchain_name)
10341035
)
10351036
mkdir(tmp_path)
10361037

0 commit comments

Comments
 (0)