Skip to content

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 4 commits into from
Mar 8, 2021
Merged

Support Mbed CLI 2 #88

merged 4 commits into from
Mar 8, 2021

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Feb 25, 2021

This PR

  • adds CMakeLists.txt to support Mbed CLI 2
  • adds an option --cli=[1|2] to test_psa_target.py to select the Mbed CLI version (defaults to 2 if unspecified)
  • updates README.md to document the use of Mbed CLI 2
  • updates the Travis configurations to use Mbed CLI 2
  • adds a CircleCI configuration to test Mbed CLI 1 build - CircleCI is used for consistency with all Mbed OS examples

Note: This PR is able to compile on its own. To be able to run it on an actual target, your check-out of mbed-os needs to have ARMmbed/mbed-os#14361.

Comment on lines -112 to -116
global TC_DICT
if not TOOLCHAIN_CLASSES[TC_DICT.get(tc)].check_executable():
msg = "Toolchain %s was not found in PATH" % tc
raise Exception(msg)

Copy link
Contributor Author

@LDong-Arm LDong-Arm Feb 25, 2021

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, but check_executable() still assumes "ARM" to be Arm Compiler 5 (armcc instead of armclang).

@ARMmbed/mbed-b-tools Is there a plan to update check_executable()? Or is it for the legacy tools only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LDong-Arm LDong-Arm changed the title WIP: Add support for Mbed CLI 2 Add support for Mbed CLI 2 Feb 25, 2021
@LDong-Arm LDong-Arm marked this pull request as draft February 25, 2021 17:38
@LDong-Arm LDong-Arm changed the title Add support for Mbed CLI 2 Support Mbed CLI 2 Mar 3, 2021
@LDong-Arm LDong-Arm force-pushed the cmake_support branch 3 times, most recently from 83bfb73 to ddfefa8 Compare March 3, 2021 16:49
@LDong-Arm LDong-Arm changed the base branch from tf-m-v1.2-integration to master March 3, 2021 16:49
This commit
* adds `CMakeLists.txt` to support Mbed CLI 2
* adds an option `--cli=[1|2]` to `test_psa_target.py` to select the
  Mbed CLI version
* updates `README.md` to document this

Mbed CLI 2 is the default build tool.

Note: In the scripts, the Arm toolchain name has been changed from
`ARMC6` to ARM because `mbed-tools` (Mbed CLI 2) does not recognize
`-t ARMC6`. However, the legacy toolchain script from Mbed OS

    TOOLCHAIN_CLASSES["ARM"].check_executable()

still assumes "ARM" to be Arm Compiler 5 and reports a failure,
so we have to remove the check from our script, and rely on the TF-M
and Mbed OS build systems to do the check.
As Mbed CLI 2 + CMake is supported now, this PR switches Travis to
test Mbed CLI 2 only. This aligns with all Mbed official examples.
@LDong-Arm LDong-Arm marked this pull request as ready for review March 4, 2021 15:47
@LDong-Arm LDong-Arm force-pushed the cmake_support branch 5 times, most recently from d99da0a to 7befa8e Compare March 4, 2021 16:15
@LDong-Arm
Copy link
Contributor Author

Sorry for the force pushes. Now both Travis and CircleCI are building. This PR is ready for review.

Copy link

@evedon evedon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@evedon
Copy link

evedon commented Mar 4, 2021

@hugueskamba or @0xc0170 Could one of you review the cmake additions? Thanks

To use Mbed CLI 2, the python package `mbed-tools` is required, and
the version of CMake needs to be at least 3.19 so we fetch the latest
from the offical PPA.
@LDong-Arm
Copy link
Contributor Author

I've just added a commit to update Vagrant scripts to support Mbed CLI 2.

@LDong-Arm
Copy link
Contributor Author

Merging this as the post binary hook has been merged to Mbed OS

@LDong-Arm LDong-Arm merged commit 9d9d70e into ARMmbed:master Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants