THanks for your reply,
Now that you mention it, I remember reading something about RAM indeed.
I have a custom PCB with a STM32F7 and a ESP-WROOM-02D for wifi, according to espressif documentation it has only 50kB SRAM.
But the program runs on the main STM32F7 which has 512kB SRAM + around 4MB in external SDRAM.
So, I am not sure where does the mbed TLS actually run ? on the ESP or the STM ?