Arm mbed tls网络和定时模块不可用

Arm mbed tls网络和定时模块不可用,arm,mbed,dtls,mbedtls,Arm,Mbed,Dtls,Mbedtls,我已经为带有ARM Mbed操作系统的K64F板编译了mbedtls。我正在尝试运行dtls_client.c和dtls_server.c中的示例。最初,在编译客户端时,我遇到以下错误: "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS" 我发现这与在config.h文件中激活这两行有关 #

我已经为带有ARM Mbed操作系统的K64F板编译了mbedtls。我正在尝试运行dtls_client.c和dtls_server.c中的示例。最初,在编译客户端时,我遇到以下错误:

"The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS"
我发现这与在config.h文件中激活这两行有关

    #define MBEDTLS_NET_C
    #define MBEDTLS_TIMING_C

I commented them and the check that requires the values:

#if !defined(MBEDTLS_SSL_CLI_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ||    \
    !defined(MBEDTLS_NET_C)  || !defined(MBEDTLS_TIMING_C) ||             \
    !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_CTR_DRBG_C) ||        \
    !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_RSA_C) ||      \
    !defined(MBEDTLS_CERTS_C) || !defined(MBEDTLS_PEM_PARSE_C)
int main( void )
{
    mbedtls_printf( "MBEDTLS_SSL_CLI_C and/or MBEDTLS_SSL_PROTO_DTLS and/or "
            "MBEDTLS_NET_C and/or MBEDTLS_TIMING_C and/or "
            "MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or "
            "MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_RSA_C and/or "
            "MBEDTLS_CERTS_C and/or MBEDTLS_PEM_PARSE_C not defined.\n" );
    return( 0 );
}
现在我看到我得到的编译错误与某些函数的重新定义有关:

main.cpp:(.text.startup.main+0x18): undefined reference to `mbedtls_net_init'
main.cpp:(.text.startup.main+0xce): undefined reference to `mbedtls_net_connect'
main.cpp:(.text.startup.main+0x2fc): undefined reference to `mbedtls_net_recv_timeout'
main.cpp:(.text.startup.main+0x300): undefined reference to `mbedtls_net_send'
main.cpp:(.text.startup.main+0x304): undefined reference to `mbedtls_net_recv'
main.cpp:(.text.startup.main+0x308): undefined reference to `mbedtls_timing_get_delay'
main.cpp:(.text.startup.main+0x30c): undefined reference to `mbedtls_timing_set_delay'
main.cpp:(.text.startup.main+0x35c): undefined reference to `mbedtls_net_free'
如何定义此调用以使其工作

这里已经回答了:

嗨,乔迪,
dtls\u client.c
dtls\u server.c
是作为mbed TLS git存储库的一部分到达的示例应用程序。
请注意,mbed OS附带其自己的mbed TLS功能目录。要测试TLS功能,您可以使用并修改它以适应DTLS协议,也可以对服务器进行测试。您还可以查看此示例,以了解如何配置dtls客户端和服务器。
我希望这有帮助
mbed TLS团队成员
罗恩