Multi-threaded app using NRF Security

Is there a known way to enable MBEDTLS_THREADING_C? I believe my application is running into MbedTLS heap corruption because multiple threads are performing crypto operations. I'm using NCS 1.7.0 and the app is running on an nRF9160.

Parents Reply Children
  • When the device my app is running on is charging, data is encrypted and sent out via BLE advertisements in one thread. The device also scans for some encrypted BLE advertisements, so the bt_rx_thread will decrypt some advertisements.

    One error is sometimes I will see
     

    hdr verify fail


    printed out to the console. Then, mbedtls_exit is called and since I have defined _exit() in my application code that reboots my app, the app reboots. Also, there's a code path in my app where a persistent public key is loaded from the key store in order to send to our server. After some time charging, this load will eventually fail with error -141 which means PSA_ERROR_INSUFFICIENT_MEMORY. 

  • Hi,

    Can you share full error log?

    Best regards,
    Dejan

Related