This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MBEDTLS_ERR_MPI_ALLOC_FAILED error

Hello

I'm working on a project inspired by the ble_thread_dyn_mtd_coap_cli example and for which I added the management of BLE LE Secure Connections (inspired by https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom. nordic.infocenter.sdk5.v12.0.0%2Fble_sdk_app_multirole_lesc.html).

Everything works fine but I found that every 28 connections the nrf52840 crashes...

After debugging, I see that I have the NRF_ERROR_CRYPTO_INTERNAL error which is returned by the backend_implementation() function in the nrf_crypto_ecc_public_key_from_raw() function of the nrf_crypto_ecc.c file.

In fact, this error comes from the mbedtls_mpi_lset() function (in the nrf_crypto_backend_mbedtls_public_key_from_raw() function of the mbedtls_backend_ecc.c file) which returns the error MBEDTLS_ERR_MPI_ALLOC_FAILED (Memory allocation failed).

Do you have any idea why I got this error? In all the libraries used by Bluetooth, there is not one that should free the memory once the device is disconnected (my application does pairing but not bonding (it does not save the keys))?

Thank you 

Related