Skip to content
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

TARGET_TFM_V1_0: compatibility with Mbed TLS 2.24.0 #14333

Conversation

LDong-Arm
Copy link
Contributor

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

Summary of changes

Mbed TLS 2.24.0 requires a few new macros and an inline function in the PSA Crypto header. This PR adds them to make sure the TF-M v1.0 target (specifically CYTFM_064B0S2_4343W) continues to compile with the new Mbed TLS.

Note: Support for older versions of TF-M than v1.2 will be dropped, so existing TF-M targets should migrate to TF-M v1.2 as soon as possible. Once Cypress has updated CYTFM_064B0S2_4343W to TF-M v1.2, we should remove the entire TARGET_TFM_V1_0 directory where this patch exists.

Impact of changes

All existing TF-M targets supported by Mbed OS, including the TF-M v1.0 CYTFM_064B0S2_4343W, now compile successfully.

Migration actions required

None.

Documentation

None.


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
Copy link
Member

@LDong-Arm, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@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.

Looks good.

@evedon
Copy link
Contributor

evedon commented Feb 23, 2021

@ARMmbed/team-cypress FYI

evedon
evedon previously approved these changes Feb 23, 2021
@mergify mergify bot added needs: CI and removed needs: review labels Feb 23, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 23, 2021

CI started

@mergify mergify bot dismissed evedon’s stale review February 24, 2021 09:29

Pull request has been modified.

@mergify mergify bot added needs: work and removed needs: CI labels Feb 24, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 24, 2021

ci restarted

@mbed-ci
Copy link

mbed-ci commented Feb 24, 2021

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-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-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@LDong-Arm
Copy link
Contributor Author

Previously, some IAR-related configs in targets.json failed Jenkins:

[2021-02-22T12:34:58.040Z]   File "./tools/toolchains/iar.py", line 64, in __init__
[2021-02-22T12:34:58.040Z]     self.check_c_lib_supported(target, "iar")
[2021-02-22T12:34:58.040Z]   File "./tools/toolchains/mbed_toolchain.py", line 1113, in check_c_lib_supported
[2021-02-22T12:34:58.040Z]     UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(target.c_lib)
[2021-02-22T12:34:58.040Z] tools.utils.NotSupportedException: std C library option not supported for this target.

Rather than fixing configs for an unsupported toolchain, I added a commit to remove IAR altogether from targets.json in this PR.

Now Jenkins passes.

But Travis seems unhappy, because it still has test cases for IAR support: https://travis-ci.com/github/ARMmbed/mbed-os/jobs/485834959.
@ARMmbed/mbed-os-tools How can we handle this?

@Patater
Copy link
Contributor

Patater commented Feb 24, 2021

@ARMmbed/mbed-os-tools How can we handle this?

We could update the tests Travis is running not to check for IAR support. This probably makes sense if we are no longer supporting IAR. Given we don't have any IAR licenses to test the support works, removing the check for IAR support makes sense to me.

@LDong-Arm
Copy link
Contributor Author

@0xc0170, @Patater:
The CI and Travis issues around IAR are not related to this task, and to properly resolve them some effort is required.
@evedon suggests that we remove any workarounds in this PR and merge it into the feature branch. Then I'll create an issue for the maintainers or tools team, which will be high priority if it blocks the merging of TF-M v1.2 support.

@Patater
Copy link
Contributor

Patater commented Feb 25, 2021

Sometimes tasks have larger scope than initially thought. Solving things without accumulating tech debt should save us work in the medium to long term.

@LDong-Arm
Copy link
Contributor Author

Sometimes tasks have larger scope than initially thought. Solving things without accumulating tech debt should save us work in the medium to long term.

I've created #14350 to fix the conflict in IAR in targets.json - I hope this fixes the issue. If that gets merged, I'll rebase this PR, then let's re-run CI.

Mbed TLS 2.24.0 requires a few new macros and an inline function in
the PSA Crypto header. This PR adds them to make sure the TF-M v1.0
target (specifically CYTFM_064B0S2_4343W) continues to compile with
the new Mbed TLS.

Note: Support for older versions of TF-M than v1.2 will be dropped,
so existing TF-M targets should migrate to TF-M v1.2 as soon as
possible.
@LDong-Arm
Copy link
Contributor Author

LDong-Arm commented Feb 25, 2021

Rebased feature-tf-m-1.2-integration and this PR to include the CI fix.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 25, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 25, 2021

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

jobs Status
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-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️

@evedon evedon merged commit 62c8379 into ARMmbed:feature-tf-m-1.2-integration Feb 25, 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.

6 participants