Hi Songwei,

 

Welcome to the list and thank you for your interest in Mbed TLS!

 

I found a similar issue on stack overflow:

https://stackoverflow.com/questions/28895703/sbrk-function-not-found-when-placed-in-a-static-library

 

Is this the same issue as yours?

 

Regards,

Janos

 

 

From: mbed-tls <mbed-tls-bounces@lists.trustedfirmware.org> on behalf of songwei fu via mbed-tls <mbed-tls@lists.trustedfirmware.org>
Reply to: "songwei.fu@web.de" <songwei.fu@web.de>
Date: Wednesday, 17 June 2020 at 10:49
To: "mbed-tls@lists.trustedfirmware.org" <mbed-tls@lists.trustedfirmware.org>
Subject: [mbed-tls] Link error when calling "altcp_tls_create_config_client"

 

Hi guys,

 

I am new to the list and also to mbedTLS. Now I am trying to port mbedTLS to chibiOS. And when I called altcp_tls_create_config_client(cert, sizeof(cert)), I got a link error like following:

 

c:/chibistudio/tools/gnu tools arm embedded/7.0 2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m\libg.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'

 

And these are my settings:

#define MBEDTLS_PLATFORM_C
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_CALLOC_MACRO   chHeapAlloc 
#define MBEDTLS_PLATFORM_FREE_MACRO     chHeapFree 

 

where chHeapAlloc and chHeapFree are the memory allocation functions from chibios. 

 

(1) Did I miss some settings? or i did something wrong? 

(2) I did not find much information about the porting from chibios side. Does anybody know where I can look for reference projects/docs?

 

Any suggestion will be appreciated. Thanks.

 

Songwei