Skip to content

Commit 1751212

Browse files
author
Nir Sonnenschein
authored
Merge pull request #9860 from SenRamakri/senMTBTestARMC6
Make ARMC6 as the default ARM toolchain for MTB targets
2 parents 214a659 + 7265ed7 commit 1751212

File tree

4 files changed

+33
-16
lines changed

4 files changed

+33
-16
lines changed

TESTS/mbed_platform/stats_sys/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void test_sys_info()
3939

4040
#if defined(__IAR_SYSTEMS_ICC__)
4141
TEST_ASSERT_EQUAL(IAR, stats.compiler_id);
42-
#elif defined(__CC_ARM)
42+
#elif defined(__ARMCC_VERSION)
4343
TEST_ASSERT_EQUAL(ARM, stats.compiler_id);
4444
#elif defined(__GNUC__)
4545
TEST_ASSERT_EQUAL(GCC_ARM, stats.compiler_id);

targets/targets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,7 +2480,7 @@
24802480
"MTB_MXCHIP_EMW3166": {
24812481
"inherits": ["FAMILY_STM32"],
24822482
"core": "Cortex-M4F",
2483-
"supported_toolchains": ["ARMC5", "uARM", "IAR", "GCC_ARM"],
2483+
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
24842484
"extra_labels_add": [
24852485
"STM32F4",
24862486
"STM32F412xG",
@@ -2512,7 +2512,7 @@
25122512
},
25132513
"USI_WM_BN_BM_22": {
25142514
"inherits": ["FAMILY_STM32"],
2515-
"supported_toolchains": ["ARMC5", "uARM", "IAR", "GCC_ARM"],
2515+
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
25162516
"components_add": ["SPIF", "FLASHIAP"],
25172517
"core": "Cortex-M4F",
25182518
"extra_labels_add": [
@@ -7694,7 +7694,7 @@
76947694
"FVP_MPS2": {
76957695
"inherits": ["ARM_FM"],
76967696
"public": false,
7697-
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
7697+
"supported_toolchains": ["GCC_ARM", "ARMC5", "IAR"],
76987698
"OUTPUT_EXT": "elf",
76997699
"device_has": [
77007700
"AACI",

tools/build_api.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ def is_official_target(target_name, version):
191191
if hasattr(target, 'release_versions') \
192192
and version in target.release_versions:
193193
if version == '2':
194-
# For version 2, either ARM or uARM toolchain support is required
195-
required_toolchains = set(['ARM', 'uARM'])
194+
# For version 2, one of the ARM toolchains(ARM, ARMC6, ARMC5 or uARM) support is required
195+
required_toolchains = set(['ARM', 'ARMC5', 'ARMC6', 'uARM'])
196196

197197
if not len(required_toolchains.intersection(
198198
set(target.supported_toolchains))) > 0:
@@ -251,20 +251,28 @@ def is_official_target(target_name, version):
251251

252252
return result, reason
253253

254-
def transform_release_toolchains(toolchains, version):
255-
""" Given a list of toolchains and a release version, return a list of
254+
def transform_release_toolchains(target, version):
255+
""" Given a release version and target, return a list of
256256
only the supported toolchains for that release
257257
258258
Positional arguments:
259259
toolchains - The list of toolchains
260260
version - The release version string. Should be a string contained within
261261
RELEASE_VERSIONS
262262
"""
263-
if version == '5':
264-
return ['ARM', 'GCC_ARM', 'IAR']
263+
if int(target.build_tools_metadata["version"]) > 0:
264+
if version == '5':
265+
if 'ARMC5' in target.supported_toolchains:
266+
return ['ARMC5', 'GCC_ARM', 'IAR']
267+
else:
268+
return ['ARM', 'ARMC6', 'GCC_ARM', 'IAR']
269+
else:
270+
return target.supported_toolchains
265271
else:
266-
return toolchains
267-
272+
if version == '5':
273+
return ['ARM', 'GCC_ARM', 'IAR']
274+
else:
275+
return target.supported_toolchains
268276

269277
def get_mbed_official_release(version):
270278
""" Given a release version string, return a tuple that contains a target
@@ -283,7 +291,7 @@ def get_mbed_official_release(version):
283291
[
284292
TARGET_MAP[target].name,
285293
tuple(transform_release_toolchains(
286-
TARGET_MAP[target].supported_toolchains, version))
294+
TARGET_MAP[target], version))
287295
]
288296
) for target in TARGET_NAMES \
289297
if (hasattr(TARGET_MAP[target], 'release_versions')
@@ -1241,6 +1249,11 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
12411249

12421250
unique_supported_toolchains = get_unique_supported_toolchains(
12431251
release_targets)
1252+
#Add ARMC5 column as well to the matrix to help with showing which targets are in ARMC5
1253+
#ARMC5 is not a toolchain class but yet we use that as a toolchain id in supported_toolchains in targets.json
1254+
#capture that info in a separate column
1255+
unique_supported_toolchains.append('ARMC5')
1256+
12441257
prepend_columns = ["Target"] + ["mbed OS %s" % x for x in RELEASE_VERSIONS]
12451258

12461259
# All tests status table print
@@ -1283,8 +1296,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
12831296
(unique_toolchain == "ARMC6" and
12841297
"ARM" in tgt_obj.supported_toolchains) or
12851298
(unique_toolchain == "ARM" and
1286-
"ARMC6" in tgt_obj.supported_toolchains and
1287-
CORE_ARCH[tgt_obj.core] == 8)):
1299+
"ARMC6" in tgt_obj.supported_toolchains)):
12881300
text = "Supported"
12891301
perm_counter += 1
12901302
else:

tools/toolchains/arm.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,13 @@ def get_config_option(self, config_header):
503503
return ["-include", config_header]
504504

505505
def get_compile_options(self, defines, includes, for_asm=False):
506+
506507
opts = ['-D%s' % d for d in defines]
507-
opts.extend(["-I%s" % i for i in includes if i])
508+
if self.RESPONSE_FILES:
509+
opts += ['@{}'.format(self.get_inc_file(includes))]
510+
else:
511+
opts += ["-I%s" % i for i in includes if i]
512+
508513
config_header = self.get_config_header()
509514
if config_header:
510515
opts.extend(self.get_config_option(config_header))

0 commit comments

Comments
 (0)