Hi there,
I've been trying to build the Google IOT MQTT Sample for the nrf9160dk_nrf9160_ns board with nRF Connect SDK 2.3.0, and I cannot get it to compile and/or link. I tried a number of different configuration options, but I believe there may be a conflict with the SDK and/or toolchain and the mbedtls library.
When I create the keys with create_keys.py then try to build exactly what's checked into zephyr/samples/net/cloud/google_iot_mqtt with west build -p auto -b nrf9160dk_nrf9160_ns I get these errors:
check_config.h:465:2: error: #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" 465 | #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" | ^~~~~check_config.h:476:2: error: #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" 476 | #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" | ^~~~~check_config.h:481:2: error: #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" 481 | #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" | ^~~~~check_config.h:486:2: error: #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" 486 | #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" | ^~~~~
I tried changing prj.conf to remove the CONFIG_MBEDTLS options and use this instead:CONFIG_NRF_SECURITY_ADVANCED=yCONFIG_NORDIC_SECURITY_BACKEND=yCONFIG_NRF_SECURITY=y
And got the same errors. I also tried using this:
CONFIG_MBEDTLS_USER_CONFIG_ENABLE=yCONFIG_MBEDTLS_USER_CONFIG_FILE="user-tls-conf.h"
And defined the missing prerequisites in user-tls-conf.h:#define MBEDTLS_HAVE_TIME#define MBEDTLS_HAVE_TIME_DATE#define MBEDTLS_PLATFORM_TIME_ALT#define MBEDTLS_PLATFORM_FPRINTF_ALT#define MBEDTLS_PLATFORM_EXIT_ALT#define MBEDTLS_PLATFORM_PRINTF_ALT#define MBEDTLS_PLATFORM_SNPRINTF_ALT
But then hit other link errors like this: multiple definition of `mbedtls_calloc'; modules/nrfxlib/nrfxlib/nrf_security/src/zephyr/libmbedtls_zephyr.a(platform.c.obj):
Can someone help me figure out how to build this sample for nrf9160 with nRF Connect SDK 2.3.0 ?