-
Notifications
You must be signed in to change notification settings - Fork 11
Support Mbed CLI 2 #88
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# CircleCI 2.1 configuration file | ||
# | ||
version: 2.1 | ||
commands: | ||
compile: | ||
parameters: | ||
target: | ||
type: string | ||
steps: | ||
- run: | | ||
cd mbed-os-tf-m-regression-tests | ||
python3 test_psa_target.py -t GNUARM -m <<parameters.target>> --cli=1 -b | ||
jobs: | ||
build: | ||
docker: | ||
- image: mbedos/mbed-os-env:stable | ||
working_directory: ~ | ||
steps: | ||
- checkout: | ||
path: mbed-os-tf-m-regression-tests | ||
- run: | | ||
apt-get update -y | ||
apt-get install -y cmake srecord ninja-build # TF-M dependencies | ||
cd mbed-os-tf-m-regression-tests | ||
git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git | ||
- compile: | ||
target: "ARM_MUSCA_S1" | ||
- compile: | ||
target: "ARM_MUSCA_B1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR) | ||
|
||
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") | ||
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "") | ||
set(APP_TARGET mbed-os-tf-m-regression-tests) | ||
|
||
include(${MBED_PATH}/tools/cmake/app.cmake) | ||
|
||
add_subdirectory(${MBED_PATH}) | ||
|
||
add_executable(${APP_TARGET}) | ||
|
||
project(${APP_TARGET}) | ||
|
||
target_sources(${APP_TARGET} | ||
PRIVATE | ||
main.cpp | ||
) | ||
|
||
# Note: This is needed because TARGET_** is part of a list instead | ||
# of a standalone variable, and it controls the path visibility | ||
# for Mbed CLI 1. Once Mbed CLI 1 is deprecated, we can simplify | ||
# the path to tfm/targets/${APP_TARGET}/device. | ||
if(${MBED_TARGET} STREQUAL "ARM_MUSCA_B1") | ||
set(TFM_TARGET_INCLUDE tfm/targets/TARGET_ARM_SSG/TARGET_MUSCA_B1/device) | ||
elseif(${MBED_TARGET} STREQUAL "ARM_MUSCA_S1") | ||
set(TFM_TARGET_INCLUDE tfm/targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/device) | ||
else() | ||
message(FATAL_ERROR "Unsupported target ${MBED_TARGET}") | ||
endif() | ||
|
||
target_include_directories(${APP_TARGET} | ||
PRIVATE | ||
tfm/platform/include | ||
${TFM_TARGET_INCLUDE} | ||
test/inc | ||
) | ||
|
||
target_link_libraries(${APP_TARGET} | ||
PRIVATE | ||
mbed-os | ||
mbed-psa | ||
mbed-greentea | ||
) | ||
|
||
if ("${MBED_CONFIG_DEFINITIONS}" MATCHES "MBED_CONF_APP_REGRESSION_TEST=1") | ||
set(TEST_LIBS | ||
# Note: To link successfully the order is important and reflects dependency. | ||
# In general: test entry point -> suites -> platform -> utilities. | ||
tfm_test_suite_core_ns | ||
tfm_test_suite_attestation_ns | ||
tfm_test_suite_crypto_ns | ||
tfm_test_suite_ipc_ns | ||
tfm_test_suite_its_ns | ||
tfm_test_suite_platform_ns | ||
tfm_test_suite_ps_ns | ||
tfm_test_suite_qcbor_ns | ||
tfm_test_suite_t_cose_ns | ||
tfm_qcbor_test | ||
tfm_t_cose_test | ||
platform_ns | ||
psa_api_ns | ||
tfm_ns_integration_test | ||
tfm_qcbor | ||
tfm_t_cose | ||
) | ||
elseif ("${MBED_CONFIG_DEFINITIONS}" MATCHES "MBED_CONF_APP_PSA_COMPLIANCE_TEST=1") | ||
set(TEST_LIBS | ||
val_nspe | ||
pal_nspe | ||
test_combine | ||
) | ||
else() | ||
message(FATAL_ERROR "No test enabled in mbed_app.json") | ||
endif() | ||
|
||
# Note: The path transformation is required because `.ar` is not | ||
# recognized by `-l<name>` of either toolchains. This extension | ||
# is a legacy of Mbed CLI 1. In the future we should use `.a` for | ||
# both toolchains, and take advantage of target_link_directories() | ||
# so each `lib<name>.a` simply becomes `<name>` in target_link_libraries(). | ||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") | ||
set(LIB_SUFFIX ".a") | ||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") | ||
set(LIB_SUFFIX ".ar") | ||
else() | ||
message(FATAL_ERROR "Unsupported toolchain ${MBED_TOOLCHAIN}") | ||
endif() | ||
|
||
list(TRANSFORM TEST_LIBS | ||
PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/test/lib/TOOLCHAIN_${MBED_TOOLCHAIN}/lib" | ||
) | ||
|
||
list(TRANSFORM TEST_LIBS | ||
APPEND "${LIB_SUFFIX}" | ||
) | ||
|
||
target_link_libraries(${APP_TARGET} | ||
PRIVATE | ||
${TEST_LIBS} | ||
) | ||
|
||
mbed_set_post_build(${APP_TARGET}) | ||
|
||
option(VERBOSE_BUILD "Have a verbose build process") | ||
if(VERBOSE_BUILD) | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are removing the toolchain check, because this PR changes "ARMC6" to "ARM" as required by
mbed-tools
, butcheck_executable()
still assumes "ARM" to be Arm Compiler 5 (armcc
instead ofarmclang
).@ARMmbed/mbed-b-tools Is there a plan to update
check_executable()
? Or is it for the legacy tools only?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/ARMmbed/mbed-os/blob/26606218ad9d1ee1c8781aa73774fd7ea3a7658e/tools/toolchains/arm.py#L67-L71