Skip to content

LPC55S69_NS: Fix baremetal compilation error #11978

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

Conversation

hugueskamba
Copy link
Collaborator

Description

Summary of change

As the psa library is not included in the baremetal profile, perform
a TFM system reset only if the psa library is included in
the build otherwise perform a normal CMSIS system reset.

Documentation

https://os.mbed.com/docs/mbed-os/v5.14/reference/mbed-os-bare-metal.html


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)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

There is an on-going effort to enable automated CI testing for baremetal. Until then it can be tested by manually building mbed-os-example-blinky-baremetal with the following command:
$ mbed compile -t gcc_arm -m lpc55s69_ns


Reviewers

@Patater @evedon


Release Notes

Summary of changes

Impact of changes

Migration actions required

As the `psa` library is not included in the baremetal profile, perform
a TFM system reset only if the `psa` library is included in
the build otherwise perform a normal CMSIS system reset.
@0xc0170 0xc0170 requested a review from a team November 28, 2019 15:05
@0xc0170 0xc0170 requested a review from a team November 28, 2019 15:10
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 28, 2019

Started CI

"name": "psa"
"name": "psa",
"config": {
"present": 1
Copy link
Contributor

@Patater Patater Nov 28, 2019

Choose a reason for hiding this comment

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

Do we need this new present or could we use #ifdef TARGET_PSA?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The macro you mentioned is always present for a given target that supports PSA regardless of whether we build with or without baremetal as it is a property of the target.

What is added in this PR is to indicate the presence of the PSA library.

TARGET_PSA = Target supports PSA
MBED_CONF_PSA_PRESENT = The PSA library is included in the build

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not include PSA in bare metal? I don't see how this target is very useful without PSA.

Copy link
Collaborator Author

@hugueskamba hugueskamba Nov 29, 2019

Choose a reason for hiding this comment

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

As per the baremetal documentation, (see PR description) PSA is not currently included in baremetal.

Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to mbedtls, we should review these and fix in the next release if possible.

Copy link
Member

Choose a reason for hiding this comment

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

The documentation for PSA is not a specification, but just explanation of current state of things. I don't see anything preventing us having PSA in bare metal mode. Will this even work without the secure image present? Maybe it makes more sense to not build PSA targets in bare metal for now?
@maclobdell @mmahadevan108

Copy link
Contributor

@evedon evedon Nov 29, 2019

Choose a reason for hiding this comment

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

Bare metal mode is enabled by using "requires": ["bare-metal"] and this turns the build system into an "opt-in" build system i.e. any library needed by the application needs to be listed in requires. So there is probably nothing that prevents a PSA target to run in bare metal mode but it does not work out-of-the-box. Until we fix this and have a proper "bare metal mode" then we need to guard PSA code with a flag like MBED_CONF_PSA_PRESENT

@mbed-ci
Copy link

mbed-ci commented Nov 28, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 29, 2019

@Patater Shall this go in, could be in 5.15 today

Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

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

OK to go in. Further work is needed to make baremetal on LPC55S69 useful.

@0xc0170 0xc0170 merged commit f2d211b into ARMmbed:master Nov 29, 2019
@hugueskamba hugueskamba deleted the hk-fix-lpc55s69_ns-baremetal-compilation branch November 29, 2019 14:26
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