I am trying to incorporate mbedTLS library to segger embOS 3.90. The mbedtls library uses heap allocation for certain operation using function mbedtls_calloc. I tried to use OS_malloc function as below. However,
#define mbedtls_calloc(a,b) OS_malloc(a*b)
But it is always returning NULL. However, if I use the same function anywhere outside mbedtls - par se, am using the function withing thread function, it seesms to be working fine.
Although root cause is unclear, it is inferred that, while utilizing OS_malloc for mbedTLS crypto purpose, it is returning NULL. Support in resolving the issue would be appreciated.