❓︎ AWS IoT MQTT sample build fails with undefined reference to 'mbedtls_ssl_*' errors (nRF9151, SDK v2.9.0)

Hello Nordic Team,

We are working on a cellular IoT application using the nRF9151 and nRF Connect SDK v2.9.0.
Our goal is to connect to AWS IoT Core using MQTT over TLS.

To begin, we used the AWS IoT MQTT sample from the SDK without making any functional changes.
We only replaced the certificates and updated endpoint information as follows:

  • Converted our AWS certificates to C files:

    • Root CA → ca.c

    • Device certificate → cert.c

    • Private key → key.c

  • Updated project configuration (proj.conf) with:

    • CONFIG_AWS_ENDPOINT

    • CONFIG_AWS_THING_NAME

    • CONFIG_AWS_PUBLISH_TOPIC

    • CONFIG_AWS_SUBSCRIBE_TOPIC

After building the project, we encountered linker errors related to missing MbedTLS symbols.
Here is the key part of the error log:


/home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_release': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:537: undefined reference to mbedtls_ssl_config_free' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:538: undefined reference to mbedtls_ssl_free' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_mbedtls_init': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1299: undefined reference to mbedtls_ssl_set_bio' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1310: undefined reference to mbedtls_ssl_config_defaults' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1390: undefined reference to mbedtls_ssl_conf_rng' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1428: undefined reference to mbedtls_ssl_setup' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1386: undefined reference to mbedtls_ssl_conf_authmode' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1402: undefined reference to mbedtls_ssl_conf_ciphersuites' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_opt_ciphersuite_list_set': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1553: undefined reference to mbedtls_ssl_conf_ciphersuites' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_session_get': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:652: undefined reference to mbedtls_ssl_session_load' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_session_restore': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:708: undefined reference to mbedtls_ssl_session_init' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:716: undefined reference to mbedtls_ssl_set_session' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:722: undefined reference to mbedtls_ssl_session_free' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_mbedtls_reset': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1166: undefined reference to mbedtls_ssl_session_reset' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_mbedtls_handshake': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1199: undefined reference to mbedtls_ssl_handshake' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_session_save': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:610: undefined reference to mbedtls_ssl_session_save' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:618: undefined reference to mbedtls_ssl_session_save' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_session_store': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:678: undefined reference to mbedtls_ssl_session_init' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:680: undefined reference to mbedtls_ssl_get_session' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:692: undefined reference to mbedtls_ssl_session_free' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function ztls_poll_prepare_pollin': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:2976: undefined reference to mbedtls_ssl_get_bytes_avail' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function ztls_socket_data_check': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:3088: undefined reference to mbedtls_ssl_read' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:3131: undefined reference to mbedtls_ssl_get_bytes_avail' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function ztls_poll_update_pollin': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:3141: undefined reference to mbedtls_ssl_get_bytes_avail' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function recv_tls': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:2589: undefined reference to mbedtls_ssl_read' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_alloc': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:467: undefined reference to mbedtls_ssl_init' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:468: undefined reference to mbedtls_ssl_config_init' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function send_tls': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:2294: undefined reference to mbedtls_ssl_write' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_opt_ciphersuite_list_get': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1571: undefined reference to mbedtls_ssl_list_ciphersuites' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function tls_opt_ciphersuite_used_get': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1599: undefined reference to mbedtls_ssl_get_ciphersuite' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1604: undefined reference to mbedtls_ssl_get_ciphersuite_id' /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function ztls_close_ctx': /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:2118: undefined reference to mbedtls_ssl_close_notify' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. FAILED: _sysbuild/sysbuild/images/aws_iot_mqtt-prefix/src/aws_iot_mqtt-stamp/aws_iot_mqtt-build /media/dnk034/NEWDATA/manoj/workspace/nrf9151/mod_firm_test_sdk_2.9.0/aws_iot_mqtt/build/_sysbuild/sysbuild/images/aws_iot_mqtt-prefix/src/aws_iot_mqtt-stamp/aws_iot_mqtt-build cd /media/dnk034/NEWDATA/manoj/workspace/nrf9151/mod_firm_test_sdk_2.9.0/aws_iot_mqtt/build/aws_iot_mqtt && /home/dnk034/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build . ninja: build stopped: subcommand failed. FATAL ERROR: command exited with status 1: /home/dnk034/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build /media/dnk034/NEWDATA/manoj/workspace/nrf9151/mod_firm_test_sdk_2.9.0/aws_iot_mqtt/build * The terminal process terminated with exit code: 1. * Terminal will be reused by tasks, press any key to close it.


proj.config
CONFIG_AWS_ENDPOINT="a2u7mbay1xxxxxxot.us-west-2.amazonaws.com" CONFIG_AWS_MQTT_PORT=8883 CONFIG_AWS_THING_NAME="xxxx" CONFIG_AWS_PUBLISH_TOPIC="zephyr_sample/data" CONFIG_AWS_SUBSCRIBE_TOPIC="zephyr_sample/downlink" CONFIG_AWS_TEST_SUITE_DQP=n CONFIG_MAIN_STACK_SIZE=4096 CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_INIT_STACKS=y CONFIG_HW_STACK_PROTECTION=y CONFIG_REQUIRES_FULL_LIBC=y CONFIG_SNTP=y CONFIG_JSON_LIBRARY=y CONFIG_POSIX_API=y # DNS CONFIG_DNS_RESOLVER=y CONFIG_DNS_RESOLVER_ADDITIONAL_BUF_CTR=2 CONFIG_DNS_RESOLVER_MAX_SERVERS=1 CONFIG_DNS_SERVER_IP_ADDRESSES=y CONFIG_DNS_SERVER1="8.8.8.8" CONFIG_NET_SOCKETS_DNS_TIMEOUT=5000 CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG=n # Generic networking options CONFIG_NETWORKING=y CONFIG_NET_UDP=y CONFIG_NET_TCP=y CONFIG_NET_IPV6=y CONFIG_NET_IPV4=y CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_SOCKOPT_TLS=y # Logging CONFIG_LOG=y # Network buffers CONFIG_NET_PKT_RX_COUNT=32 CONFIG_NET_PKT_TX_COUNT=16 CONFIG_NET_BUF_RX_COUNT=64 CONFIG_NET_BUF_TX_COUNT=32 # MQTT CONFIG_MQTT_LIB=y CONFIG_MQTT_LIB_TLS=y CONFIG_MQTT_KEEPALIVE=60 CONFIG_MQTT_LIB_TLS_USE_ALPN=y # TLS CONFIG_MBEDTLS=y CONFIG_MBEDTLS_BUILTIN=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=65536 CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=16384 CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT=y CONFIG_MBEDTLS_SERVER_NAME_INDICATION=y CONFIG_MBEDTLS_AES_ROM_TABLES=y CONFIG_MBEDTLS_TLS_VERSION_1_2=y CONFIG_MBEDTLS_MEMORY_DEBUG=y CONFIG_MBEDTLS_HAVE_TIME_DATE=y CONFIG_MBEDTLS_SSL_ALPN=y


Despite this, the build fails with undefined references to MbedTLS SSL APIs (as shown above).


Environment:

  • Hardware: nRF9151 custom board

  • nRF Connect SDK: v2.9.0

  • Toolchain: Zephyr SDK (arm-zephyr-eabi-gcc 12.2.0)

  • Sample: aws_iot_mqtt


Question:

Why are these mbedtls_ssl_* references undefined even though MbedTLS is enabled in configuration?
Is there an additional library, configuration, or Kconfig dependency we need to enable for TLS in SDK v2.9.0?

We would appreciate any guidance or pointers to resolve this linker issue and successfully build the AWS IoT MQTT sample.

Thank you,

milan

Parents
  • Hi,

    Do you use Zephyr aws_iot_mqtt sample?
    Can you try to use aws_iot sample instead? What is the result?

    Can you please upload your prj.conf and complete build log?
    You can do this by clicking on Upload or on Image/video/file -> Upload.

    Best regards,
    Dejan

  • aws_iot_mqtt build config error log:


    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_release':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:537: undefined reference to `mbedtls_ssl_config_free'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:538: undefined reference to `mbedtls_ssl_free'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_mbedtls_init':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1299: undefined reference to `mbedtls_ssl_set_bio'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1310: undefined reference to `mbedtls_ssl_config_defaults'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1390: undefined reference to `mbedtls_ssl_conf_rng'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1428: undefined reference to `mbedtls_ssl_setup'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1386: undefined reference to `mbedtls_ssl_conf_authmode'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1402: undefined reference to `mbedtls_ssl_conf_ciphersuites'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_opt_ciphersuite_list_set':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1553: undefined reference to `mbedtls_ssl_conf_ciphersuites'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_session_get':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:652: undefined reference to `mbedtls_ssl_session_load'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_session_restore':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:708: undefined reference to `mbedtls_ssl_session_init'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:716: undefined reference to `mbedtls_ssl_set_session'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:722: undefined reference to `mbedtls_ssl_session_free'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_mbedtls_reset':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1166: undefined reference to `mbedtls_ssl_session_reset'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_mbedtls_handshake':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1199: undefined reference to `mbedtls_ssl_handshake'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_session_save':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:610: undefined reference to `mbedtls_ssl_session_save'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:618: undefined reference to `mbedtls_ssl_session_save'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_session_store':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:678: undefined reference to `mbedtls_ssl_session_init'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:680: undefined reference to `mbedtls_ssl_get_session'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:692: undefined reference to `mbedtls_ssl_session_free'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `ztls_poll_prepare_pollin':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:2976: undefined reference to `mbedtls_ssl_get_bytes_avail'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `ztls_socket_data_check':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:3088: undefined reference to `mbedtls_ssl_read'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:3131: undefined reference to `mbedtls_ssl_get_bytes_avail'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `ztls_poll_update_pollin':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:3141: undefined reference to `mbedtls_ssl_get_bytes_avail'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `recv_tls':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:2589: undefined reference to `mbedtls_ssl_read'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_alloc':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:467: undefined reference to `mbedtls_ssl_init'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:468: undefined reference to `mbedtls_ssl_config_init'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `send_tls':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:2294: undefined reference to `mbedtls_ssl_write'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_opt_ciphersuite_list_get':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1571: undefined reference to `mbedtls_ssl_list_ciphersuites'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `tls_opt_ciphersuite_used_get':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1599: undefined reference to `mbedtls_ssl_get_ciphersuite'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:1604: undefined reference to `mbedtls_ssl_get_ciphersuite_id'
    /home/dnk034/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/net/libsubsys__net.a(sockets_tls.c.obj): in function `ztls_close_ctx':
    /home/dnk034/ncs/v2.9.0/zephyr/subsys/net/lib/sockets/sockets_tls.c:2118: undefined reference to `mbedtls_ssl_close_notify'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/aws_iot_mqtt-prefix/src/aws_iot_mqtt-stamp/aws_iot_mqtt-build /media/dnk034/NEWDATA/manoj/workspace/nrf9151/mod_firm_test_sdk_2.9.0/aws_iot_mqtt/build/_sysbuild/sysbuild/images/aws_iot_mqtt-prefix/src/aws_iot_mqtt-stamp/aws_iot_mqtt-build
    cd /media/dnk034/NEWDATA/manoj/workspace/nrf9151/mod_firm_test_sdk_2.9.0/aws_iot_mqtt/build/aws_iot_mqtt && /home/dnk034/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/dnk034/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build /media/dnk034/NEWDATA/manoj/workspace/nrf9151/mod_firm_test_sdk_2.9.0/aws_iot_mqtt/build

    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

    proj.config

    CONFIG_AWS_ENDPOINT="a31goxxxxxxxxx.iot.eu-west-1.amazonaws.com"
    CONFIG_AWS_MQTT_PORT=8883
    CONFIG_AWS_THING_NAME="zephyr_sample"
    CONFIG_AWS_PUBLISH_TOPIC="zephyr_sample/data"
    CONFIG_AWS_SUBSCRIBE_TOPIC="zephyr_sample/downlink"
    CONFIG_AWS_TEST_SUITE_DQP=n

    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_ENTROPY_GENERATOR=y
    CONFIG_TEST_RANDOM_GENERATOR=y
    CONFIG_INIT_STACKS=y
    CONFIG_HW_STACK_PROTECTION=y
    CONFIG_REQUIRES_FULL_LIBC=y
    CONFIG_SNTP=y
    CONFIG_JSON_LIBRARY=y
    CONFIG_POSIX_API=y

    # DNS
    CONFIG_DNS_RESOLVER=y
    CONFIG_DNS_RESOLVER_ADDITIONAL_BUF_CTR=2
    CONFIG_DNS_RESOLVER_MAX_SERVERS=1
    CONFIG_DNS_SERVER_IP_ADDRESSES=y
    CONFIG_DNS_SERVER1="8.8.8.8"
    CONFIG_NET_SOCKETS_DNS_TIMEOUT=5000
    CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG=n

    # Generic networking options
    CONFIG_NETWORKING=y
    CONFIG_NET_UDP=y
    CONFIG_NET_TCP=y
    CONFIG_NET_IPV6=y
    CONFIG_NET_IPV4=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_SOCKOPT_TLS=y

    # Logging
    CONFIG_LOG=y

    # Network buffers
    CONFIG_NET_PKT_RX_COUNT=32
    CONFIG_NET_PKT_TX_COUNT=16
    CONFIG_NET_BUF_RX_COUNT=64
    CONFIG_NET_BUF_TX_COUNT=32

    # MQTT
    CONFIG_MQTT_LIB=y
    CONFIG_MQTT_LIB_TLS=y
    CONFIG_MQTT_KEEPALIVE=60
    CONFIG_MQTT_LIB_TLS_USE_ALPN=y

    # TLS
    CONFIG_MBEDTLS=y
    CONFIG_MBEDTLS_BUILTIN=y
    CONFIG_MBEDTLS_ENABLE_HEAP=y
    CONFIG_MBEDTLS_HEAP_SIZE=65536
    CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=16384
    CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT=y
    CONFIG_MBEDTLS_SERVER_NAME_INDICATION=y
    CONFIG_MBEDTLS_AES_ROM_TABLES=y
    CONFIG_MBEDTLS_TLS_VERSION_1_2=y
    CONFIG_MBEDTLS_MEMORY_DEBUG=y
    CONFIG_MBEDTLS_HAVE_TIME_DATE=y
    CONFIG_MBEDTLS_SSL_ALPN=y

    kconfig:

    #
    # Copyright (c) 2023 Lucas Dietrich <[email protected]>
    #
    # SPDX-License-Identifier: Apache-2.0
    #

    menu "AWS"
    mainmenu "AWS IoT Core MQTT sample application"

    config AWS_ENDPOINT
    string "AWS endpoint"
    default ""
    help
    Endpoint (hostname) of the AWS MQTT broker.
    Note that the endpoint is different when using AWS Device Advisor.

    config AWS_MQTT_PORT
    int "MQTT Port"
    default 8883
    help
    Set port of AWS MQTT broker.

    config AWS_THING_NAME
    string "AWS Thing name"
    default "myThingName"
    help
    Set the AWS Thing name created on IoT Console

    config AWS_SUBSCRIBE_TOPIC
    string "MQTT subscribe topic"
    default "myThingName/downlink"
    help
    MQTT topic the client should subscribe to.

    config AWS_PUBLISH_TOPIC
    string "MQTT publish topic"
    default "myThingName/data"
    help
    MQTT topic the client should publish to.

    choice AWS_TEST_SUITE
    prompt "Device Advisor test suite"
    default AWS_TEST_SUITE_NONE
    help
    Select the AWS Device Advisor test suite to run.

    config AWS_TEST_SUITE_NONE
    bool "No test suite running"

    config AWS_TEST_SUITE_DQP
    bool "Device Qualification Program (DQP)"
    help
    Make sure your region supports AWS Device Advisor for DQP

    config AWS_TEST_SUITE_RECV_QOS1
    bool "Test suite for receiving QoS 1 messages"
    help
    For single test case "MQTT Client Puack QoS1"

    endchoice

    config AWS_QOS
    int "MQTT QoS"
    default 0 if AWS_TEST_SUITE_DQP
    default 1 if AWS_TEST_SUITE_RECV_QOS1
    default 0
    range 0 1
    help
    Quality of Service to use for publishing and subscribing to topics.
    Notes:
    - Use QoS 0 when passing DQP test suite
    - QoS 2 is not supported by AWS MQTT broker


    config AWS_EXPONENTIAL_BACKOFF
    bool "enable exponential backoff"
    default n if AWS_TEST_SUITE_DQP || AWS_TEST_SUITE_RECV_QOS1
    default y
    help
    Enable AWS exponential backoff for reconnecting to AWS MQTT broker.

    endmenu

    source "Kconfig.zephyr"

    cmake:

    # SPDX-License-Identifier: Apache-2.0

    cmake_minimum_required(VERSION 3.20.0)

    find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
    project(aws_iot_mqtt)

    if(USE_DUMMY_CREDS)
    set(creds "src/creds/dummy.c")
    else()
    if(NOT EXISTS ${APPLICATION_SOURCE_DIR}/src/creds/key.c OR
    NOT EXISTS ${APPLICATION_SOURCE_DIR}/src/creds/cert.c OR
    NOT EXISTS ${APPLICATION_SOURCE_DIR}/src/creds/ca.c)
    message(FATAL_ERROR
    "Credentials not found. Please run "
    "'python3 src/creds/convert_keys.py' before building"
    )
    endif()

    set(creds "src/creds/ca.c" "src/creds/key.c" "src/creds/cert.c")
    endif()

    target_sources(app PRIVATE "src/main.c" ${creds})
    target_sources_ifdef(CONFIG_NET_DHCPV4 app PRIVATE "src/dhcp.c")

    and code we dont any changes done


    this is our aws iot mqtt example build error log and proj config this is not correctly build right now we set certs correctly using py script as needed and update end point etc. as needed 

    in only aws iot example run and build successfully but this has no option to add certificate etc. options

    we want to use aws iot mqtt example instead of aws iot  because it help me for mqtt manage, aws and it certificate add manage to build this program and tell us why sample code of aws_iot_mqtt is not build successfully,and this is take our huge number of ram so also solution of these

    if aws iot example code we manage certificate and easily publish subscribe with different topic this is possible please tell us also because this is less number of ram uses

    best regards,
    Milan

  • Hi Milan,

    Milan Pipaliya said:
    When we try to set the certificates using nRF Connect app → Cellular Monitor → Cellular Manager, we first apply CFUN=4, add the certificates, and set the security tag. However, it continuously shows “cert updating” and never completes the update process.

    You can double-check if you have properly generated certificates using Cellular Monitor Certificate Manager. Do you have a screenshot which shows "cert updating"?

    Milan Pipaliya said:
    The aws_iot example project configuration includes MCUboot and other system settings. Because of this, our custom PCB does not boot properly — it seems the reason is that no child image is created. There are multiple configuration files such as board/board.conf, sysbuild/proj.conf, and the main project config, which makes it a bit confusing how the child image is actually executed. If you have any suggestions on how to handle this, that would be very helpful.

    Below are some resources related to sysbuild:
    sysbuild
    configuring sysbuild
    sysbuild
    sysbuild images
    sysbuild explained
    migrating to sysbuild

    Milan Pipaliya said:

    In the aws_iot_mqtt example, we can successfully build and run it on our custom PCB. The cellular connection, certificate, and endpoint setup all complete correctly. However, we’re facing two runtime issues:

    • SNTP time error: It returns error -22, but when we debug and execute slowly, it sometimes succeeds in getting the time.

    • AWS connection error: It gives error -116, even though our certificates and endpoint are configured correctly.

    Can you share complete log which shows mentioned errors?

    Best regards,
    Dejan

  • Hi Dejan,

    Thank you for the support.

    Our aws_iot_mqtt sample is now running properly on our custom PCB, and certificates + endpoint configuration are working fine. However, we are still facing one issue:

    Issue: Long connection delay after reset/flash

    Many times, when we reset the board or flash the firmware, the modem shows the log:

    Waiting 30 minutes – restricted LTE network

    After this long wait, the device eventually connects and successfully sends data to AWS IoT.
    So the connection works correctly, but the initial attach sometimes takes a very long time.

    If needed, we can share logs for the cases where the connection delay happens.

    Please suggest what could cause this restricted LTE wait or how we can avoid this long delay during attach.

    we try in coap client example code and some time we want this kind of issue also facing

    we are using hologram esim 

    Best regards,
    Milan

  • Hi Milan,

    Which network does your device connect to?

    Milan Pipaliya said:

    Issue: Long connection delay after reset/flash

    Many times, when we reset the board or flash the firmware, the modem shows the log:

    Waiting 30 minutes – restricted LTE network

    Can you check if your device encountered modem reset loop restriction?
    Reset loop can be detected by the modem. Please have a look at modem domain event notifications %MDMEV.

    Best regards,
    Dejan

  • we have network of hologram esim lte network

    we not reset we only flash new code that time starting 30 minutes restriction after code work as it is

  • Hi,

    Milan Pipaliya said:
    we have network of hologram esim lte network

    Which network operator does your device connect to? Can you provide link to your network operator's webpage?

    Have you checked if you get any additional message when using previously mentioned %MDMEV?

    Is your device able to recover and continue to work as expected after 30 minutes restriction has passed?

    Best regards,
    Dejan

Reply
  • Hi,

    Milan Pipaliya said:
    we have network of hologram esim lte network

    Which network operator does your device connect to? Can you provide link to your network operator's webpage?

    Have you checked if you get any additional message when using previously mentioned %MDMEV?

    Is your device able to recover and continue to work as expected after 30 minutes restriction has passed?

    Best regards,
    Dejan

Children
Related