Skip to content

CMake: Add support for all ARM SSG Mbed targets #13968

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 7 commits into from
Jan 20, 2021

Conversation

hugueskamba
Copy link
Collaborator

Summary of changes

CMake: Add support for all ARM SSG Mbed targets

Impact of changes

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Nov 26, 2020
@ciarmcom ciarmcom requested review from a team November 26, 2020 11:30
@ciarmcom
Copy link
Member

@hugueskamba, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/team-arm-oss-platform @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-security @ARMmbed/mbed-os-maintainers please review.

0xc0170
0xc0170 previously approved these changes Nov 26, 2020
@mbed-ci
Copy link

mbed-ci commented Nov 26, 2020

Jenkins CI Test : ❌ FAILED

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM
jenkins-ci/mbed-os-ci_cmake-example-ARM
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️

@rajkan01
Copy link
Contributor

rajkan01 commented Nov 26, 2020

Changes look good to me.

As this PR change removes mbed-psa lib and all PSA sources become part of the mbed-core library. we need to update all the below examples CMakeLists.txt as it target_link_libraries aginst mbed-psa

Copy link
Contributor

@rajkan01 rajkan01 left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify
Copy link

mergify bot commented Nov 26, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@hugueskamba hugueskamba force-pushed the hk_cmake_arm_ssg_support branch from 5013f53 to b5a9086 Compare November 26, 2020 16:10
@hugueskamba hugueskamba requested a review from 0xc0170 November 26, 2020 16:10
@mergify mergify bot dismissed 0xc0170’s stale review November 26, 2020 16:11

Pull request has been modified.

@mergify
Copy link

mergify bot commented Nov 27, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 1, 2020

698d828 - what's the reason , psa is not separate library but mbed specific extension to the core ? why it does not make sense to be a separate library?

@mergify
Copy link

mergify bot commented Dec 1, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@hugueskamba
Copy link
Collaborator Author

One last question:

what's the reason , psa is not separate library but mbed specific extension to the core ? why it does not make sense to be a separate library?

I asked previously, but can't find an answer now here. Can't it be mbed-psa library and if a target depends on it it links to it ?

The reply is here.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 18, 2021

Thanks, if core depends on it, can it link - so we would preserve psa CMake target and core links to it?

Include PSA source files only if a given Mbed target needs it.
This commit also consolidates CMakeLists.txt files within the platform
directory
Add CMakeLists.txt input source file for the target
Add CMakeLists.txt file for the target
@hugueskamba hugueskamba force-pushed the hk_cmake_arm_ssg_support branch from 21d78a1 to a132586 Compare January 18, 2021 17:39
@hugueskamba
Copy link
Collaborator Author

Thanks, if core depends on it, can it link - so we would preserve psa CMake target and core links to it?

Used the approach suggested instead.

The ASM flags were not supported by armclang, use the armclang alternatives.
Removed armlink --cpu flag as they generate a CMake configuration
time error. Furthermore, it is not necessary to specify the
processor or architecture as the linker auto-detects it from
the input object files.
See: https://developer.arm.com/documentation/101754/0615/armlink-Reference/armlink-Command-line-Options/--cpu-name--armlink-
@hugueskamba hugueskamba force-pushed the hk_cmake_arm_ssg_support branch from a132586 to 53cc382 Compare January 18, 2021 17:51
@mbed-ci
Copy link

mbed-ci commented Jan 18, 2021

Jenkins CI Test : ❌ FAILED

Build Number: 6 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 19, 2021

I'll restart the test soon

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 19, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 19, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 7 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@0xc0170 0xc0170 merged commit d841c77 into ARMmbed:master Jan 20, 2021
@mergify mergify bot removed the ready for merge label Jan 20, 2021
@hugueskamba hugueskamba deleted the hk_cmake_arm_ssg_support branch January 20, 2021 10:56
@LDong-Arm
Copy link
Contributor

Good to see Mbed applications now compile for those targets.
Note that in order to support Musca B1 and S1, the compiled application needs to be signed then concatenated with MCUboot and TF-M binaries. The scripts to do this need to be integrated with Mbed CLI 2.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 26, 2021

Note that in order to support Musca B1 and S1, the compiled application needs to be signed then concatenated with MCUboot and TF-M binaries. The scripts to do this need to be integrated with Mbed CLI 2.

Can you point where it is done in the old tools, is this part of the post build hook (we are looking at it currently) ?

@LDong-Arm
Copy link
Contributor

Can you point where it is done in the old tools, is this part of the post build hook (we are looking at it currently) ?

Yes, the entry point is the post build hook tools/targets/<TARGET>.py, which then uses tools/psa/tfm/bin_utils/.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 26, 2021

It should be fixed in the next release.

@mbedmain mbedmain removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants