I'm working on an embedded system that has CMSIS FreeRtos with heap4 as memory management scheme.
Now I'm trying to port the mbedTls to my system and I must provide dynamic allocation functions like alloc and free.
mbedTLS require two function to allocate and free memory. These are the function prototypes required by mbedTLS:
void * (*mbedtls_calloc)( size_t, size_t ) = MBEDTLS_PLATFORM_STD_CALLOC;
void (*mbedtls_free)( void * ) = MBEDTLS_PLATFORM_STD_FREE;
int mbedtls_platform_set_calloc_free( void * (*calloc_func)( size_t, size_t ),
void (*free_func)( void * ) )
Which is the best way to use correctly the heap provided by FreeRTOS? Memory pool for example.
Heap4 does not provide function like calloc and free. So, which function should I wrap to allow mbedTls to allocate memory?
Thanks in advance for the help.
Federico