Linking AWS FreeRTOS demo code's mbedtls net_sockets mbedtls_net_recv and mbedtls_net_send?

I’m trying to merge some code that calls the mbedtls_net_recv and mbedtls_net_send functions from the AWS FreeRTOS demo code’s net_sockets.h and .c files but can’t get the CMake code to compile and link these two functions. The two function names show up in the file in the build directory, but ONLY for where they are called from and NOT from the net_sockets.c file.

Is there some setting in one of the CMake files in the demo code that needs to be set to be able to compile/link this file and it’s functions?


These functions come from mbedtls\library\net_sockets.c file. Are you compiling that file?

This is the CMake portion to build mbedTLS:


The CMakeLists.txt file you “link to” above is the same CMakeLists.txt file that is in the amazon-freertos\libraries\3rdparty directory of the FreeRTOS code I’m trying to compile, and it still doesn’t compile/link the net_sockets.h and .c files even though other files in the same directories do compile/link.

I’m “new” to using CMake so I don’t understand how to get this done. I’ve tried using “#include directory/file_name.h” from where these functions are called, but apparently CMake prevents that from working.

Any recommendations or what to try next? As I’m “lost”!