cancel
Showing results for 
Search instead for 
Did you mean: 

mbed-crypto APIs not working in either SBSFUAppliSecure or SBSFUAppliNonSecure

Nitin
Associate III

Hi I am working on SBSFU Application project from STM32U585 project. And I am trying to use mbed-crypto APIs like SHA512 APIs as below

 
mbedtls_platform_setup(NULL);
mbedtls_sha512_init(&sha512_context);
mbedtls_sha512_starts(&sha512_context, 0); // 0 for standard SHA-512
mbedtls_sha512_update(&sha512_context, data, data_len);
mbedtls_sha512_finish(&sha512_context, sha512_hash);
for(int i =0;i<64;i++)
{
    printf(" %x",sha512_hash[i]);
}
/printf("\n SHA512 Computed");
mbedtls_sha512_free(&sha512_context);

What I am experiencing here is that I am seeing frequent reset of the controller  during execution. I would like to know the possibility of same situation ever faced by other person also. Or is their any other configuration I have enable in default config file.

Need help, thanks in advance...

@Jocelyn RICARD 

1 REPLY 1
STea
ST Employee

Hello @Nitin ,

In which context those calls are used? if it is in the non-secure project context you need to do so with PSA API calls to call for crypto services from secure in a proper way this usecase is implemented in the TFM application example project which can be found under:

STM32Cube_FW_U5_V1.6.0\Projects\B-U585I-IOT02A\Applications\TFM
see TFM\TFM_Appli\NonSecure\Src\tfm_app.c
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.