-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fix compile error for Mbed TF-M V8M target #88
base: master
Are you sure you want to change the base?
Conversation
Fix compile error for Mbed TF-M V8M target, usually without FLASHIAP 1. Use DEVICE_FLASH to exclude FLASHIAP code 2. Fix MBED_MAJOR_VERSION doesn't get in to exclude mbedtls_psa_crypto_free().
Have a look? |
Thank you, I'll take a look. |
@@ -14,6 +14,7 @@ | |||
// limitations under the License. | |||
// ---------------------------------------------------------------------------- | |||
#ifdef MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT | |||
#include "platform/mbed_version.h" |
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.
@ccli8
I don't see any of the #define in this file being used: https://github.com/ARMmbed/mbed-os/blob/master/platform/include/platform/mbed_version.h
What compile errors are you seeing without this include file?
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.
@marcuschangarm I met link error with undefined mbedtls_psa_crypto_free
symbol:
Compile [100.0%]: psa_driver_crypto.c
[Warning] psa_driver_crypto.c@547,5: implicit declaration of function 'mbedtls_psa_crypto_free' is invalid in C99 [-Wimplicit-function-declaration]
Link: mbed-cloud-client-example
[Warning] @0,0: L3912W: Option 'legacyalign' is deprecated.
[Error] @0,0: L6218E: Undefined symbol mbedtls_psa_crypto_free (referred from BUILD/NU_M2354/ARM/mbed-cloud-client/factory-configurator-client/psa-driver/source/psa_driver_crypto.o).
Checking the lines below, MBED_MAJOR_VERSION
is not available, which is defined in mbed_version.h
:
mbed-cloud-client/factory-configurator-client/psa-driver/source/psa_driver_crypto.c
Lines 543 to 548 in d7edc52
SA_PV_LOG_TRACE_FUNC_ENTER_NO_ARGS(); | |
#if !(defined(TARGET_TFM) && (MBED_MAJOR_VERSION > 5)) | |
mbedtls_psa_crypto_free(); | |
#endif | |
SA_PV_LOG_TRACE_FUNC_EXIT_NO_ARGS(); |
Thanks @ccli8 @marcuschangarm I'll mark this for next public release as the changes have already been integrated internally. |
[x] I confirm this contribution is my own and I agree to license it with Apache 2.0.
[x] I confirm the moderators may change the PR before merging it in.
[x] I understand the release model prohibits detailed Git history and my contribution will be recorded to the list at the bottom of CONTRIBUTING.md.
Summary of changes
This PR tries to fix compile error for Mbed TF-M V8M target, usually without
FLASHIAP
:DEVICE_FLASH
to excludeFLASHIAP
codeMBED_MAJOR_VERSION
isn't available, which is needed to excludembedtls_psa_crypto_free()
.