Mbed forum

Memory leak using more task

(mattia settin) #1

i’m having a very a memory leak crash using the mbedtls library.
My application run on a stm32F4 microcontroller, with a FreeRTOS and mbed tls library,
I have 3 different task witch perform three operation. These 3 task share the mbedtls library.
The question is: the define MBEDTLS_THREADING_C shall be enable or disable when more task that use/share the mebdtls ?
thank you
best regards

(Ron Eldor) #2

Dear Mattia,

Thank you for your interest in Mbed TLS!

When you are working on a multithreaded environment, you should enable MBEDTLS_THREADING_C . You should also set your mutex functionality, as the default implementation uses pthread.

You can find more information in https://tls.mbed.org/kb/development/thread-safety-and-multi-threading and other KB articles at the same location.


Mbed TLS Team member

(mattia settin) #3

Dear Roneld
Thank you for solve my question.
Best regards