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

Fix compile error for Mbed TF-M V8M target #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------
#ifdef MBED_CONF_MBED_CLOUD_CLIENT_PSA_SUPPORT
#include "platform/mbed_version.h"

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?

Copy link
Author

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:

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();

#include "psa_driver.h"
#include "psa/protected_storage.h"
#include "psa/crypto.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ palStatus_t pal_plat_imageActivate(palImageId_t imageId)

palStatus_t pal_plat_imageGetActiveHash(palBuffer_t *hash)
{
#if DEVICE_FLASH
palStatus_t ret = PAL_ERR_UPDATE_ERROR;
uint32_t read_offset = PAL_UPDATE_ACTIVE_METADATA_HEADER_OFFSET +
offsetof(FirmwareHeader_t, firmwareSHA256);
Expand Down Expand Up @@ -95,6 +96,9 @@ palStatus_t pal_plat_imageGetActiveHash(palBuffer_t *hash)

exit:
return ret;
#else
return PAL_ERR_NOT_IMPLEMENTED;
#endif
}

palStatus_t pal_plat_imageGetActiveVersion (palBuffer_t* version)
Expand Down