Re: mbedtls and memory allocator


Tomasz Bursztyka
 

Hi Sergio,

now as a reference how to enable you can take a look to

samples/net/mbedtls_dtlsclient

in the file dtls_client.c look for

#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
#include "mbedtls/memory_buffer_alloc.h"
static unsigned char heap[20480];
#endif

There a heap is statically created and eventually you have to assign the heap with the function

#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
mbedtls_memory_buffer_alloc_init(heap, sizeof(heap));
#endif


For that point on mbedtls will use its own memory allocator

Let me know if this helps
Indeed, that I could not guess it from mbedtls includes.

That helps a lot! :)

Thank you

Tomasz

Join devel@lists.zephyrproject.org to automatically receive all group messages.